Skip to content

Commit

Permalink
Update to capybara2.
Browse files Browse the repository at this point in the history
  Update related gems and add capybara-screenshot.
  • Loading branch information
Travis Gaff committed Mar 20, 2013
1 parent 421d3bf commit 599eafd
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 29 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ end
group :test do
gem 'webmock'
gem "factory_girl_rails"
gem 'capybara', '~> 1.1.4'
gem 'capybara', '>= 2.0.1'
gem "poltergeist"
gem "launchy"
gem "database_cleaner"
gem 'shoulda-matchers'
gem "faker"
gem 'capybara-screenshot'
end
23 changes: 12 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ GEM
bourne (1.1.2)
mocha (= 0.10.5)
builder (3.0.4)
capybara (1.1.4)
capybara (2.0.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
xpath (~> 1.0.0)
capybara-screenshot (0.3.4)
capybara (>= 1.0, < 3)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
coderay (1.0.9)
Expand Down Expand Up @@ -128,7 +130,7 @@ GEM
multi_json (1.7.1)
multipart-post (1.2.0)
nested_form (0.3.1)
nokogiri (1.5.6)
nokogiri (1.5.8)
oauth2 (0.8.1)
faraday (~> 0.8)
httpauth (~> 0.1)
Expand All @@ -146,12 +148,10 @@ GEM
omniauth (~> 1.0)
orm_adapter (0.4.0)
pg (0.14.1)
poltergeist (1.0.2)
capybara (~> 1.1)
childprocess (~> 0.3)
poltergeist (1.1.0)
capybara (~> 2.0, >= 2.0.1)
faye-websocket (~> 0.4, >= 0.4.4)
http_parser.rb (~> 0.5.3)
multi_json (~> 1.0)
polyglot (0.3.3)
pry (0.9.12)
coderay (~> 1.0.5)
Expand Down Expand Up @@ -189,7 +189,7 @@ GEM
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.0)
Expand Down Expand Up @@ -246,11 +246,11 @@ GEM
multi_json (~> 1.0, >= 1.0.2)
warden (1.2.1)
rack (>= 1.0)
webmock (1.10.1)
webmock (1.11.0)
addressable (>= 2.2.7)
crack (>= 0.3.2)
websocket (1.0.7)
xpath (0.1.4)
xpath (1.0.0)
nokogiri (~> 1.3)

PLATFORMS
Expand All @@ -260,7 +260,8 @@ DEPENDENCIES
active_hash
awesome_print
bootstrap-sass-rails
capybara (~> 1.1.4)
capybara (>= 2.0.1)
capybara-screenshot
coffee-rails
database_cleaner
devise (~> 2.2.3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
end_time_selects[1].select "45"
end

select "Alaska", from: 'event_time_zone'
select "(GMT-09:00) Alaska", from: 'event_time_zone'
fill_in "event_details", :with => "This is a note in the detail text box\n With a new line!<script>alert('hi')</script> and a (missing) javascript injection, as well as an unclosed <h1> tag"

click_button "Create Event"
Expand Down Expand Up @@ -92,8 +92,8 @@
fill_in "rsvp_teaching_experience", :with => "I have taught all kinds of things."
check 'Teaching'

page.find("input[type='checkbox'][value='#{@session1.id}']").should be_checked
page.find("input[type='checkbox'][value='#{@session2.id}']").should be_checked
page.first("input[type='checkbox'][value='#{@session1.id}']").should be_checked
page.first("input[type='checkbox'][value='#{@session2.id}']").should be_checked

uncheck "Curriculum"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

it "lets the user manage volunteers" do
visit organize_event_path(@event)
click_link "Manage Volunteers"
within('.mission-control-actions') { click_link 'Manage Volunteers' }

page.should have_content("Assign Volunteer")
end

Expand Down Expand Up @@ -72,4 +73,4 @@
page.should have_content 'Checked In'
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@event = create(:event)
@event.organizers << @user_organizer

sign_in_as(@user_organizer)

visit "/events/#{@event.id}/organizers"
Expand Down Expand Up @@ -62,7 +62,7 @@
page.should_not have_selector('input[value="Remove"]')
end

it "should remove the organizer and display the removed organizer int the user select" do
it "should remove the organizer and display the removed organizer in the user select" do
@event.organizers << @user1
visit "/events/#{@event.id}/organizers"

Expand All @@ -72,4 +72,4 @@
removed_user.value.should eq(@user1.id.to_s)
removed_user.text.should eq(@user1.full_name)
end
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
fill_in "user_first_name", :with => @user.first_name
fill_in "user_last_name", :with => @user.last_name
fill_in "Email", :with => @user.email
fill_in "Password", :with => @user.password
fill_in "Password confirmation", :with => @user.password
fill_in 'user_password', with: @user.password
fill_in 'user_password_confirmation', with: @user.password
click_button "Sign up"
page.should have_content("A message with a confirmation link has been sent to your email address. Please open the link to activate your account.")
end
Expand All @@ -33,7 +33,7 @@
page.should have_content("Sign in")
current_path.should == new_user_session_path
end

describe "is signed in" do
before do
sign_in_as(@user)
Expand All @@ -44,14 +44,14 @@
page.should have_link("Sign Out")
page.should_not have_link("Sign In")
page.should_not have_link("Sign Up")
end
end
end

it "should see sign up link on the home page" do
visit '/'
page.should have_link("Sign Up")
end

it "should be able to sign up from the home page" do
visit '/'
click_link("Sign Up")
Expand All @@ -68,4 +68,4 @@
page.should have_link("Profile")
end
end
end
end
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'
require 'capybara-screenshot/rspec'
require 'webmock/rspec'

Capybara.javascript_driver = :poltergeist
Expand All @@ -12,7 +13,7 @@

RSpec.configure do |config|
config.mock_with :rspec

config.use_transactional_fixtures = false

config.before(:suite) do
Expand All @@ -38,7 +39,7 @@
#Uncomment if need to write tests using devise helpers
#config.extend ControllerMacros, :type => :controller
config.include Devise::TestHelpers, :type => :controller

config.include FactoryGirl::Syntax::Methods
end

0 comments on commit 599eafd

Please sign in to comment.