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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
43f69e05
Commit
43f69e05
authored
May 02, 2018
by
blackst0ne
Committed by
Rémy Coutable
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the `admin/push_rules.feature` spinach test with an rspec analog
parent
2c8acf86
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
33 deletions
+54
-33
ee/changelogs/unreleased/blackst0ne-replace-spinach-admin-push-rules-feature.yml
...d/blackst0ne-replace-spinach-admin-push-rules-feature.yml
+5
-0
ee/spec/features/admin/admin_interacts_with_push_rules_spec.rb
...ec/features/admin/admin_interacts_with_push_rules_spec.rb
+49
-0
features/admin/push_rules.feature
features/admin/push_rules.feature
+0
-9
features/steps/admin/push_rules.rb
features/steps/admin/push_rules.rb
+0
-20
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+0
-4
No files found.
ee/changelogs/unreleased/blackst0ne-replace-spinach-admin-push-rules-feature.yml
0 → 100644
View file @
43f69e05
---
title
:
'
Replace
the
`admin/push_rules.feature`
spinach
test
with
an
rspec
analog'
merge_request
:
5512
author
:
"
@blackst0ne"
type
:
other
ee/spec/features/admin/admin_push_rules_spec.rb
→
ee/spec/features/admin/admin_
interacts_with_
push_rules_spec.rb
View file @
43f69e05
require
'spec_helper'
require
"spec_helper"
describe
"Admin
::PushRules"
do
describe
"Admin
interacts with push rules"
do
let
(
:current_
user
)
{
create
(
:admin
)
}
set
(
:
user
)
{
create
(
:admin
)
}
before
do
before
do
sign_in
(
current_
user
)
sign_in
(
user
)
end
end
push_rules_with_titles
=
{
push_rules_with_titles
=
{
reject_unsigned_commits:
'Reject unsigned commits'
,
reject_unsigned_commits:
"Reject unsigned commits"
,
commit_committer_check:
'Committer restriction'
commit_committer_check:
"Committer restriction"
}
}
push_rules_with_titles
.
each
do
|
rule_attr
,
title
|
push_rules_with_titles
.
each
do
|
rule_attr
,
title
|
context
"when
#{
rule_attr
}
is unlicensed"
do
context
"when
#{
rule_attr
}
is unlicensed"
do
before
do
before
do
stub_licensed_features
(
rule_attr
=>
false
)
stub_licensed_features
(
rule_attr
=>
false
)
end
it
'does not render the setting checkbox'
do
visit
admin_push_rule_path
expect
(
page
).
not_to
have_content
(
title
)
visit
(
admin_push_rule_path
)
end
end
it
{
expect
(
page
).
not_to
have_content
(
title
)
}
end
end
context
"when
#{
rule_attr
}
is licensed"
do
context
"when
#{
rule_attr
}
is licensed"
do
before
do
before
do
stub_licensed_features
(
rule_attr
=>
true
)
stub_licensed_features
(
rule_attr
=>
true
)
visit
(
admin_push_rule_path
)
end
end
it
'renders the setting checkbox'
do
it
{
expect
(
page
).
to
have_content
(
title
)
}
visit
admin_push_rule_path
end
end
expect
(
page
).
to
have_content
(
title
)
context
"when creating push rule"
do
before
do
visit
(
admin_push_rule_path
)
end
end
it
"creates new rule"
do
fill_in
(
"Commit message"
,
with:
"my_string"
)
click_button
(
"Save Push Rules"
)
expect
(
page
).
to
have_selector
(
"input[value='my_string']"
)
end
end
end
end
end
end
features/admin/push_rules.feature
deleted
100644 → 0
View file @
2c8acf86
@admin
Feature
:
Admin push rules sample
Background
:
Given
I sign in as an admin
And
I visit push rules page
Scenario
:
I
can create push rule sample
When
I fill in a form and submit
Then
I see my push rule saved
features/steps/admin/push_rules.rb
deleted
100644 → 0
View file @
2c8acf86
require
'webmock'
class
Spinach::Features::AdminPushRulesSample
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
RSpec
::
Matchers
include
RSpec
::
Mocks
::
ExampleMethods
include
WebMock
::
API
step
'I fill in a form and submit'
do
fill_in
"Commit message"
,
with:
"my_string"
click_button
"Save Push Rules"
end
step
'I see my push rule saved'
do
visit
admin_push_rule_path
expect
(
page
).
to
have_selector
(
"input[value='my_string']"
)
end
end
features/steps/shared/paths.rb
View file @
43f69e05
...
@@ -200,10 +200,6 @@ module SharedPaths
...
@@ -200,10 +200,6 @@ module SharedPaths
visit
admin_spam_logs_path
visit
admin_spam_logs_path
end
end
step
'I visit push rules page'
do
visit
admin_push_rule_path
end
step
'I visit admin license page'
do
step
'I visit admin license page'
do
visit
admin_license_path
visit
admin_license_path
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