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
Jérome Perrin
gitlab-ce
Commits
a0c48ec6
Commit
a0c48ec6
authored
Dec 13, 2016
by
jurre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Admin Appearance spinach feature to rspec
parent
60f61096
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
41 deletions
+76
-41
features/admin/appearance.feature
features/admin/appearance.feature
+0
-37
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+0
-4
spec/features/admin/admin_appearance_spec.rb
spec/features/admin/admin_appearance_spec.rb
+76
-0
No files found.
features/admin/appearance.feature
deleted
100644 → 0
View file @
60f61096
Feature
:
Admin Appearance
Scenario
:
Create new appearance
Given
I sign in as an admin
And
I visit admin appearance page
When
submit form with new appearance
Then
I should be redirected to admin appearance page
And
I should see newly created appearance
Scenario
:
Preview appearance
Given
application has custom appearance
And
I sign in as an admin
When
I visit admin appearance page
And
I click preview button
Then
I should see a customized appearance
Scenario
:
Custom sign-in page
Given
application has custom appearance
When
I visit login page
Then
I should see a customized appearance
Scenario
:
Appearance logo
Given
application has custom appearance
And
I sign in as an admin
And
I visit admin appearance page
When
I attach a logo
Then
I should see a logo
And
I remove the logo
Then
I should see logo removed
Scenario
:
Header logos
Given
application has custom appearance
And
I sign in as an admin
And
I visit admin appearance page
When
I attach header logos
Then
I should see header logos
And
I remove the header logos
Then
I should see header logos removed
features/steps/shared/paths.rb
View file @
a0c48ec6
...
@@ -195,10 +195,6 @@ module SharedPaths
...
@@ -195,10 +195,6 @@ module SharedPaths
visit
admin_groups_path
visit
admin_groups_path
end
end
step
'I visit admin appearance page'
do
visit
admin_appearances_path
end
step
'I visit admin teams page'
do
step
'I visit admin teams page'
do
visit
admin_teams_path
visit
admin_teams_path
end
end
...
...
features/steps/admin/appearance
.rb
→
spec/features/admin/admin_appearance_spec
.rb
View file @
a0c48ec6
class
Spinach::Features::AdminAppearance
<
Spinach
::
FeatureSteps
require
'spec_helper'
include
SharedAuthentication
include
SharedPaths
feature
'Admin Appearance'
,
feature:
true
do
let!
(
:appearance
)
{
create
(
:appearance
)
}
scenario
'Create new appearance'
do
login_as
:admin
visit
admin_appearances_path
step
'submit form with new appearance'
do
fill_in
'appearance_title'
,
with:
'MyCompany'
fill_in
'appearance_title'
,
with:
'MyCompany'
fill_in
'appearance_description'
,
with:
'dev server'
fill_in
'appearance_description'
,
with:
'dev server'
click_button
'Save'
click_button
'Save'
end
step
'I should be redirected to admin appearance page'
do
expect
(
current_path
).
to
eq
admin_appearances_path
expect
(
current_path
).
to
eq
admin_appearances_path
expect
(
page
).
to
have_content
'Appearance settings'
expect
(
page
).
to
have_content
'Appearance settings'
end
step
'I should see newly created appearance'
do
expect
(
page
).
to
have_field
(
'appearance_title'
,
with:
'MyCompany'
)
expect
(
page
).
to
have_field
(
'appearance_title'
,
with:
'MyCompany'
)
expect
(
page
).
to
have_field
(
'appearance_description'
,
with:
'dev server'
)
expect
(
page
).
to
have_field
(
'appearance_description'
,
with:
'dev server'
)
expect
(
page
).
to
have_content
'Last edit'
expect
(
page
).
to
have_content
'Last edit'
end
end
step
'I click preview button'
do
scenario
'Preview appearance'
do
login_as
:admin
visit
admin_appearances_path
click_link
"Preview"
click_link
"Preview"
end
step
'application has custom appearance'
do
expect_page_has_custom_appearance
(
appearance
)
create
(
:appearance
)
end
end
s
tep
'I should see a customized appearanc
e'
do
s
cenario
'Custom sign-in pag
e'
do
expect
(
page
).
to
have_content
appearance
.
title
visit
new_user_session_path
expect
(
page
).
to
have_content
appearance
.
description
expect
_page_has_custom_appearance
(
appearance
)
end
end
step
'I attach a logo'
do
scenario
'Appearance logo'
do
attach_file
(
:appearance_logo
,
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
))
login_as
:admin
click_button
'Save'
visit
admin_appearances_path
end
step
'I attach header logos'
do
attach_file
(
:appearance_logo
,
logo_fixture
)
attach_file
(
:appearance_header_logo
,
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
))
click_button
'Save'
click_button
'Save'
end
expect
(
page
).
to
have_css
(
logo_selector
)
step
'I should see a logo'
do
click_link
'Remove logo'
expect
(
page
).
to
have_xpath
(
'//img[@src="/uploads/appearance/logo/1/dk.png"]'
)
expect
(
page
).
not_to
have_css
(
logo_selector
)
end
end
s
tep
'I should see h
eader logos'
do
s
cenario
'H
eader logos'
do
expect
(
page
).
to
have_xpath
(
'//img[@src="/uploads/appearance/header_logo/1/dk.png"]'
)
login_as
:admin
end
visit
admin_appearances_path
step
'I remove the logo'
do
attach_file
(
:appearance_header_logo
,
logo_fixture
)
click_
link
'Remove logo
'
click_
button
'Save
'
end
expect
(
page
).
to
have_css
(
header_logo_selector
)
step
'I remove the header logos'
do
click_link
'Remove header logo'
click_link
'Remove header logo'
expect
(
page
).
not_to
have_css
(
header_logo_selector
)
end
def
expect_page_has_custom_appearance
(
appearance
)
expect
(
page
).
to
have_content
appearance
.
title
expect
(
page
).
to
have_content
appearance
.
description
end
end
step
'I should see logo removed'
do
def
logo_selector
expect
(
page
).
not_to
have_xpath
(
'//img[@src="/uploads/appearance/logo/1/gitlab_logo.png"]'
)
'//img[@src^="/uploads/appearance/logo"]'
end
end
step
'I should see header logos removed'
do
def
header_logo_selector
expect
(
page
).
not_to
have_xpath
(
'//img[@src="/uploads/appearance/header_logo/1/header_logo_light.png"]'
)
'//img[@src^="/uploads/appearance/header_logo"]'
end
end
def
appearanc
e
def
logo_fixtur
e
Appearance
.
last
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
)
end
end
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