Permalink
Browse files

updated with let function

  • Loading branch information...
mashbash committed Jun 3, 2012
1 parent 1f50fca commit a9b6d2851346d2d58cf0815110ab7dedec2705d9
Showing with 7 additions and 9 deletions.
  1. +7 −9 spec/requests/static_pages_spec.rb
@@ -2,6 +2,8 @@
describe "Static pages" do
+ let(:base_title) { "Ruby on Rails Tutorial Sample App" }
+
describe "Home page" do
it "should have the h1 'Sample App'" do
@@ -11,8 +13,7 @@
it "should have the title 'Home'" do
visit '/static_pages/home'
- page.should have_selector('title',
- :text => "Ruby on Rails Tutorial Sample App | Home")
+ page.should have_selector('title', :text => "#{base_title} | Home")
end
end
@@ -25,8 +26,7 @@
it "should have the title 'Help'" do
visit '/static_pages/help'
- page.should have_selector('title',
- :text => "Ruby on Rails Tutorial Sample App | Help")
+ page.should have_selector('title', :text => "#{base_title} | Help")
end
end
@@ -39,12 +39,11 @@
it "should have the title 'About Us'" do
visit '/static_pages/about'
- page.should have_selector('title',
- :text => "Ruby on Rails Tutorial Sample App | About Us")
+ page.should have_selector('title', :text => "#{base_title} | About Us")
end
end
- describe "Contact page" do
+ describe "Contact page" do
it "should have the h1 'Contact'" do
visit '/static_pages/contact'
@@ -53,8 +52,7 @@
it "should have the title 'Contact'" do
visit '/static_pages/contact'
- page.should have_selector('title',
- :text => "Ruby on Rails Tutorial Sample App | Contact")
+ page.should have_selector('title', :text => "#{base_title} | Contact")
end
end
end

0 comments on commit a9b6d28

Please sign in to comment.