Last active
August 29, 2015 13:56
-
-
Save ogryzek/9086657 to your computer and use it in GitHub Desktop.
rspec Homepage Features, Controller, Model examples
This file contains 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
require 'spec_helper' | |
describe HomepageController do | |
describe "#index" do | |
it "is successful" do | |
get :index | |
expect(response).to be_success | |
end | |
end | |
end |
This file contains 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
require 'spec_helper' | |
feature "Homepage" do | |
scenario "User sees product information" do | |
visit "/" | |
expect(page).to have_text("Our Products") | |
expect(page).to have_text("Bikes") | |
expect(page).to have_text("1,500.00") | |
end | |
scenario "User can view bikes" do | |
visit "/" | |
click_on "Bikes" | |
fill_in "max-price", with: 3000 | |
click_on "View Bikes" | |
expect(page).to have_text("Results") | |
expect(current_path).to eq("/bikes-results") | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment