Skip to content

Instantly share code, notes, and snippets.

@harushimo
Created December 7, 2012 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harushimo/4230470 to your computer and use it in GitHub Desktop.
Save harushimo/4230470 to your computer and use it in GitHub Desktop.
ruby code
require 'spec_helper'
describe "StaticPages" do
describe "Home page" do
it "should have the content 'Sample App'" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
end
Failures:
1) StaticPages Home page should have the content 'Sample App'
Failure/Error: visit '/static_pages/home'
NoMethodError:
undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007fc223a7ecb0>
# ./spec/requests/static_pages_spec.rb:9:in `block (3 levels) in <top (required)>'
Finished in 0.01733 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/requests/static_pages_spec.rb:7 # StaticPages Home page should have the content 'Sample App'
Randomized with seed 35058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment