Skip to content

Commit

Permalink
specs with capybara are working, sign up does
Browse files Browse the repository at this point in the history
  • Loading branch information
santiago-dev96 committed Jan 22, 2020
1 parent 2f51cf9 commit 0b7486b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ group :test do
gem 'capybara', '~> 2.13'
gem 'rails-controller-testing'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end

group :development, :test do
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ GEM
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
archive-zip (0.12.0)
io-like (~> 0.3.0)
arel (8.0.0)
ast (2.4.0)
bindex (0.8.1)
Expand All @@ -53,6 +55,9 @@ GEM
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
childprocess (3.0.0)
chromedriver-helper (2.1.1)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand All @@ -71,6 +76,7 @@ GEM
activesupport (>= 4.2.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jaro_winkler (1.5.4)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -211,6 +217,7 @@ PLATFORMS
DEPENDENCIES
byebug
capybara (~> 2.13)
chromedriver-helper
coffee-rails (~> 4.2)
database_cleaner
jbuilder (~> 2.5)
Expand Down
20 changes: 20 additions & 0 deletions spec/system/sign_ups_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'rails_helper'

RSpec.describe "SignUps", type: :system do
before do
driven_by(:selenium_chrome)
end

it 'signs up a user' do
visit('/')
click_link('Sign up')
expect(page).to have_current_path(new_user_path)
fill_in('Name', with: 'bob')
count = User.count
click_on('Create User')
expect(User.count).to eq(count + 1)
bob = User.find_by(name: 'bob')
expect(bob).not_to be_nil
expect(page).to have_current_path(user_path(bob))
end
end

0 comments on commit 0b7486b

Please sign in to comment.