Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
0763b5ea
Commit
0763b5ea
authored
Aug 19, 2016
by
Lin Jen-Shin
Committed by
James Edwards-Jones
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for checking pages setting
parent
e6a7eb43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
spec/features/projects/pages_spec.rb
spec/features/projects/pages_spec.rb
+58
-0
No files found.
spec/features/projects/pages_spec.rb
0 → 100644
View file @
0763b5ea
require
'spec_helper'
feature
'Pages'
,
feature:
true
do
given
(
:project
)
{
create
(
:empty_project
)
}
given
(
:user
)
{
create
(
:user
)
}
given
(
:role
)
{
:master
}
background
do
project
.
team
<<
[
user
,
role
]
login_as
(
user
)
end
shared_examples
'no pages deployed'
do
scenario
'does not see anything to destroy'
do
visit
namespace_project_pages_path
(
project
.
namespace
,
project
)
expect
(
page
).
not_to
have_link
(
'Remove pages'
)
expect
(
page
).
not_to
have_text
(
'Only the project owner can remove pages'
)
end
end
context
'when user is the owner'
do
background
do
project
.
namespace
.
update
(
owner:
user
)
end
context
'when pages deployed'
do
background
do
allow_any_instance_of
(
Project
).
to
receive
(
:pages_deployed?
)
{
true
}
end
scenario
'sees "Remove pages" link'
do
visit
namespace_project_pages_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_link
(
'Remove pages'
)
end
end
it_behaves_like
'no pages deployed'
end
context
'when the user is not the owner'
do
context
'when pages deployed'
do
background
do
allow_any_instance_of
(
Project
).
to
receive
(
:pages_deployed?
)
{
true
}
end
scenario
'sees "Only the project owner can remove pages" text'
do
visit
namespace_project_pages_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_text
(
'Only the project owner can remove pages'
)
end
end
it_behaves_like
'no pages deployed'
end
end
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