Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented Rspec let function

  • Loading branch information...
commit 13b61a8aa3c90f0e4314c76a3839bb1c8d92f5c1 1 parent 8663107
@safalmj authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 spec/requests/static_pages_spec.rb
View
7 spec/requests/static_pages_spec.rb
@@ -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
@@ -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
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.