Created
September 26, 2011 23:22
-
-
Save phillipoertel/1243730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Gemfile | |
group :test do | |
gem "rspec" | |
gem "capybara" | |
# ... | |
end | |
### spec_helper.rb | |
# ... | |
require 'capybara/rails' | |
require 'capybara/rspec' | |
# ... | |
### spec/requests/some_spec.rb | |
feature "Creating a flat" do | |
scenario "i get a validation error when price info is missing" do | |
visit(root_path) | |
click_on('Add flat') | |
click_on('Continue') | |
fill_in('Street', :with => 'Kazmairstraße 42') | |
fill_in('Neighbourhood', :with => 'Westend') | |
fill_in('Square meters', :with => '25') | |
click_on('Create') | |
page.should have_content('2 errors prohibited this flat from being saved') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment