Skip to content

Instantly share code, notes, and snippets.

Created March 27, 2015 07:52
Show Gist options
  • Save anonymous/a3d11899ed2da170e852 to your computer and use it in GitHub Desktop.
Save anonymous/a3d11899ed2da170e852 to your computer and use it in GitHub Desktop.
Capybara.test
context "HAPPY PATHS" do
#...
scenario "create a parking lot and check hints count" do
@tenant.default_location.parking_lots.first.destroy
click_link "Create Parking Lot"
fill_in "Name", with: "Parking Lot 4"
select "Corporate", from: "Workgroup"
click_button "Submit"
success_messages ["Parking Lot successfully created."]
has_no_error_message
expect(page).to have_css("table#parking_lots tr", count: 3)
expect(page).to have_css("table#parking_lots tr", text: "Parking Lot 4")
expect(@tenant.default_location.parking_lots.find_by_name("Parking Lot 4").hints.count).to eq(4)
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment