Skip to main content
added 20 characters in body
Source Link
Thilo
  • 17.8k
  • 5
  • 70
  • 86

I am trying to follow TDD on Rails Tutorial which is available online here

While testing first app, I got an error.

My spec.rb code is this:

require 'spec_helper'

describe "Static pages" do
  describe "Home page" do

    it "should have the content 'Sample App'" do
      visit '/static_pages/home'
      page.should have_content('Sample App')
    end
  end
end

After running testing I got this error:

Failure/Error: visit '/static_pages/home'
 NoMethodError:
   undefined method `visit' for #    <RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa833e5c># ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

I will really appreciate your help.

I am trying to follow TDD on Rails Tutorial which is available online here

While testing first app, I got an error.

My spec.rb code is this:

require 'spec_helper'

describe "Static pages" do
describe "Home page" do

it "should have the content 'Sample App'" do
  visit '/static_pages/home'
  page.should have_content('Sample App')
end
end
end

After running testing I got this error:

Failure/Error: visit '/static_pages/home'
 NoMethodError:
   undefined method `visit' for #    <RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa833e5c># ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

I will really appreciate your help.

I am trying to follow TDD on Rails Tutorial which is available online here

While testing first app, I got an error.

My spec.rb code is this:

require 'spec_helper'

describe "Static pages" do
  describe "Home page" do

    it "should have the content 'Sample App'" do
      visit '/static_pages/home'
      page.should have_content('Sample App')
    end
  end
end

After running testing I got this error:

Failure/Error: visit '/static_pages/home'
 NoMethodError:
   undefined method `visit' for #    <RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa833e5c># ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

I will really appreciate your help.

edited tags
Link
chhantyal
  • 12.3k
  • 9
  • 55
  • 79
Source Link
chhantyal
  • 12.3k
  • 9
  • 55
  • 79

Ruby on Rails TDD; Error while testing

I am trying to follow TDD on Rails Tutorial which is available online here

While testing first app, I got an error.

My spec.rb code is this:

require 'spec_helper'

describe "Static pages" do
describe "Home page" do

it "should have the content 'Sample App'" do
  visit '/static_pages/home'
  page.should have_content('Sample App')
end
end
end

After running testing I got this error:

Failure/Error: visit '/static_pages/home'
 NoMethodError:
   undefined method `visit' for #    <RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa833e5c># ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in <top (required)>'

I will really appreciate your help.