-
Notifications
You must be signed in to change notification settings - Fork 0
/
'
67 lines (57 loc) · 1.9 KB
/
'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require 'spec_helper'
include ApplicationHelper
describe "Static pages" do
subject { page }
shared_examples_for "all static pages" do
it { should have_selector('h1', text: heading) }
it { should have_selector('title', text: full_title(page_title)) }
end
describe "Home page" do
before { visit root_path }
let(:heading) { 'Sample App' }
let(:page_title) { '' }
it_should_behave_like "all static pages"
it { should_not have_selector 'title', text: '| Home' }
end
describe "Help page" do
before {visit help_path }
let(:heading) {'Help'}
let(:page_title) {'Help'}
it_should_behave_like "all static pages"
end
describe "About page" do
before {visit about_path }
let(:heading) {'About Us'}
let(:page_title) {'About Us'}
it_should_behave_like "all static pages"
end
describe "Contact page" do
before {visit contact_path }
let(:heading) {'Contact'}
let(:page_title) {'Contact'}
it_should_behave_like "all static pages"
end
describe "signup page" do
before { visit signup_path }
let(:heading) {'Sign up'}
let(:page_title) {'Sign up'}
it_should_behave_like "all static pages"
end
it "should have the right links on the layout" do
visit root_path
click_link "About"
page.should have_selector 'title', text: full_title('About Us')
click_link "Help"
page.should have_selector 'title', text: full_title('Help')
click_link "Contact"
page.should have_selector 'title', text: full_title('Contact')
click_link "Home"
page.should have_selector 'title', text: full_title('')
page.should_not have_selector 'title', text: '| Home'
click_link "Sign up now!"
page.should have_selector 'title', text: full_title('Sign up')
click_link "sample app"
page.should have_selector 'title', text: full_title('')
page.should_not have_selector 'title', text: '| Home'
end
end