Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails-tutorials
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tô Ngọc Ánh
rails-tutorials
Commits
cf6c3f40
Commit
cf6c3f40
authored
Jun 23, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ex2: Add variable title
parent
13dadb1d
Pipeline
#654
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
sample_app/spec/requests/static_pages_spec.rb
+7
-4
No files found.
sample_app/spec/requests/static_pages_spec.rb
View file @
cf6c3f40
...
@@ -12,6 +12,8 @@ require 'rails_helper'
...
@@ -12,6 +12,8 @@ require 'rails_helper'
describe
"Static pages"
do
describe
"Static pages"
do
let
(
:base_title
)
{
"Ruby on Rails Tutorial Sample App"
}
describe
"Home page"
do
describe
"Home page"
do
it
"should have the content 'Sample App'"
do
it
"should have the content 'Sample App'"
do
visit
'/static_pages/home'
visit
'/static_pages/home'
...
@@ -20,7 +22,7 @@ describe "Static pages" do
...
@@ -20,7 +22,7 @@ describe "Static pages" do
it
"should have the right title"
do
it
"should have the right title"
do
visit
'/static_pages/home'
visit
'/static_pages/home'
expect
(
page
).
to
have_title
(
"
Ruby on Rails Tutorial Sample App
| Home"
)
expect
(
page
).
to
have_title
(
"
#{
base_title
}
| Home"
)
end
end
end
end
...
@@ -32,7 +34,7 @@ describe "Static pages" do
...
@@ -32,7 +34,7 @@ describe "Static pages" do
it
"should have the title 'Help'"
do
it
"should have the title 'Help'"
do
visit
'/static_pages/help'
visit
'/static_pages/help'
expect
(
page
).
to
have_title
(
"
Ruby on Rails Tutorial Sample App
| Help"
)
expect
(
page
).
to
have_title
(
"
#{
base_title
}
| Help"
)
end
end
end
end
...
@@ -44,7 +46,7 @@ describe "Static pages" do
...
@@ -44,7 +46,7 @@ describe "Static pages" do
it
"should have the title 'About Us'"
do
it
"should have the title 'About Us'"
do
visit
'/static_pages/about'
visit
'/static_pages/about'
expect
(
page
).
to
have_title
(
"
Ruby on Rails Tutorial Sample App
| About Us"
)
expect
(
page
).
to
have_title
(
"
#{
base_title
}
| About Us"
)
end
end
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment