Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 7th, 2012  |  syntax: None  |  size: 2.62 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. FF.......
  2.  
  3.     Failures:
  4.  
  5.       1) Static pages Home page should have the h1 'Sample App'
  6.          Failure/Error: page.should have_selector('h1', text: 'Sample App')
  7.            expected css "h1" with text "Sample App" to return something
  8.          # ./spec/requests/static_pages_spec.rb:6:in `block (3 levels) in <top (required)>'
  9.  
  10.       2) Static pages Home page should have the base title
  11.          Failure/Error: page.should have_selector('title',
  12.            expected css "title" with text "Ruby on Rails Tutorial Sample App" to return something
  13.          # ./spec/requests/static_pages_spec.rb:10:in `block (3 levels) in <top (required)>'
  14.  
  15.     Finished in 0.38131 seconds
  16.     9 examples, 2 failures
  17.  
  18.     Failed examples:
  19.  
  20.     rspec ./spec/requests/static_pages_spec.rb:4 # Static pages Home page should have the h1 'Sample App'
  21.     rspec ./spec/requests/static_pages_spec.rb:8 # Static pages Home page should have the base title
  22.        
  23. require 'spec_helper'
  24. describe "Static pages" do
  25.   describe "Home page" do
  26.     it "should have the h1 'Sample App'" do
  27.       visit root_path
  28.       page.should have_selector('h1', text: 'Sample App')
  29.     end
  30.     it "should have the base title" do
  31.       visit root_path
  32.       page.should have_selector('title',
  33.                         text: "Ruby on Rails Tutorial Sample App")
  34.     end
  35.     it "should not have a custom page title" do
  36.       visit root_path
  37.       page.should_not have_selector('title', text: '| Home')
  38.     end
  39.   end
  40. describe "Help page" do
  41.     it "should have the h1 'Help me'" do
  42.         visit help_path
  43.         page.should have_selector('h1', text: 'Help me')
  44.     end
  45. it "should have the title 'Help me'" do
  46.   visit help_path
  47.    page.should have_selector('title',
  48.                 text: "Ruby on Rails Tutorial Sample App | Help me")
  49. end
  50. end
  51. describe "About page" do
  52.   it "should have the h1 'About us'" do
  53.     visit about_path
  54.     page.should have_selector('h1', text: 'About us')
  55.   end
  56. it "should have the title 'About us'" do
  57.   visit about_path
  58.   page.should have_selector('title',
  59.                 text: "Ruby on Rails Tutorial Sample App | About us")
  60.     end
  61.   end
  62.  
  63.   describe "Contact page" do
  64.   it "should have the h1 'Contact'" do
  65.     visit contact_path
  66.     page.should have_selector('h1', text: 'Contact')
  67.   end
  68.  
  69. it "should have the title 'Contact'" do
  70.   visit contact_path
  71.   page.should have_selector('title',
  72.                 text: "Ruby on Rails Tutorial Sample App | Contact")
  73.     end
  74.   end
  75. end
  76.        
  77. SampleApp::Application.routes.draw do
  78.       root to: 'static_pages#home'
  79.  
  80.       match '/help', to: 'static_pages#help'
  81.       match '/about', to: 'static_pages#about'
  82.       match '/contact', to: 'static_pages#contact'
  83. end