Skip to content

Commit

Permalink
Implemented Rspec let function
Browse files Browse the repository at this point in the history
  • Loading branch information
safalmj committed Aug 14, 2012
1 parent 8663107 commit 13b61a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/requests/static_pages_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'

describe "StaticPages" do
let(:base_title) {"Ruby on Rails Tutorial Sample App"}

describe "Home page" do
it "should have the h1 'Sample App'" do
Expand All @@ -13,7 +14,7 @@
it "should have title page 'Home'" do
visit '/static_pages/home'
page.should have_selector('title',
:text => 'Ruby on Rails Tutorial Sample App | Home')
:text => "#{base_title} | Home")
end
end

Expand All @@ -27,7 +28,7 @@
it "should have title 'Help'" do
visit '/static_pages/help'
page.should have_selector('title',
:text => 'Ruby on Rails Tutorial Sample App | Help')
:text => "#{base_title} | Help")
end
end

Expand All @@ -40,7 +41,7 @@
it "should have title 'About Us'" do
visit "/static_pages/about"
page.should have_selector('title',
:text =>'Ruby on Rails Tutorial Sample App | About')
:text =>"#{base_title} | About")
end
end
end

0 comments on commit 13b61a8

Please sign in to comment.