Skip to content

Instantly share code, notes, and snippets.

@andrewhl
Created February 25, 2012 21:39
Show Gist options
  • Save andrewhl/1910987 to your computer and use it in GitHub Desktop.
Save andrewhl/1910987 to your computer and use it in GitHub Desktop.
Running: spec/requests/main_spec.rb
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/andrew/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.5/lib/guard/rspec/formatters/notification_rspec.rb", "spec/requests/main_spec.rb"]...
..F
Failures:
1) Main Index page should have a test page path
Failure/Error: visit test_path
NameError:
undefined local variable or method `test_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x00000104d0de78>
# ./spec/requests/main_spec.rb:20:in `block (3 levels) in <top (required)>'
Finished in 0.46468 seconds
3 examples, 1 failure
Failed examples:
rspec ./spec/requests/main_spec.rb:19 # Main Index page should have a test page path
Done.
class MainController < ApplicationController
def index
end
def test
end
end
require 'spec_helper'
describe "Main" do
let(:base_title) { "Leo Baeck Signup System" }
describe "Index page" do
it "should have the content 'Welcome'" do
visit '/main/index'
page.should have_content('Welcome')
end
it "should have the right title" do
visit '/main/index'
page.should have_selector('title', :text => "#{base_title} | Home")
end
it "should have a test page path" do
visit test_path
end
end
end
SignupSystem::Application.routes.draw do
resources :main
get "main/test"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment