Last active
December 22, 2015 00:58
-
-
Save andrewhavens/6392707 to your computer and use it in GitHub Desktop.
Example of a Capybara feature file, imperative style
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
| feature "widget management" do | |
| background do | |
| @user = Fabricate(:user) | |
| visit auth_login_path | |
| fill_in "Username", with: @user.username | |
| fill_in "Password", with: "password" | |
| click_button "Log In" | |
| end | |
| scenario "creating a new widget" do | |
| visit root_url | |
| click_link "New Widget" | |
| fill_in "Name", with: "Awesome Widget" | |
| click_button "Create Widget" | |
| expect(page).to have_text("Widget was successfully created.") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compare to Capybara feature file, declarative style