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
5748f9af
Commit
5748f9af
authored
Jul 08, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to addon form data shared example
parent
e9922349
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
ee/spec/support/shared_examples/views/subscription_shared_examples.rb
...ort/shared_examples/views/subscription_shared_examples.rb
+19
-0
ee/spec/views/subscriptions/buy_minutes.html.haml_spec.rb
ee/spec/views/subscriptions/buy_minutes.html.haml_spec.rb
+1
-1
No files found.
ee/spec/support/shared_examples/views/subscription_shared_examples.rb
View file @
5748f9af
# frozen_string_literal: true
RSpec
.
shared_examples_for
'subscription form data'
do
|
js_selector
|
before
do
allow
(
view
).
to
receive
(
:subscription_data
).
and_return
(
...
...
@@ -18,3 +19,21 @@ RSpec.shared_examples_for 'subscription form data' do |js_selector|
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-plan-id='bronze_id']"
)
}
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-source='some_source']"
)
}
end
RSpec
.
shared_examples_for
'addon form data'
do
|
js_selector
|
before
do
allow
(
view
).
to
receive
(
:addon_data
).
and_return
(
plan_data:
'[{"id":"ci_minutes_plan_id","code":"ci_minutes","price_per_year":10.0}]'
,
namespace_id:
'1'
,
plan_id:
'ci_minutes_plan_id'
,
source:
'some_source'
)
end
subject
{
render
}
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-plan-data='[{
\"
id
\"
:
\"
ci_minutes_plan_id
\"
,
\"
code
\"
:
\"
ci_minutes
\"
,
\"
price_per_year
\"
:10.0}]']"
)
}
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-plan-id='ci_minutes_plan_id']"
)
}
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-namespace-id='1']"
)
}
it
{
is_expected
.
to
have_selector
(
"
#{
js_selector
}
[data-source='some_source']"
)
}
end
ee/spec/views/subscriptions/buy_minutes.html.haml_spec.rb
View file @
5748f9af
...
...
@@ -3,5 +3,5 @@
require
'spec_helper'
RSpec
.
describe
'subscriptions/buy_minutes'
do
it_behaves_like
'
subscripti
on form data'
,
'#js-buy-minutes'
it_behaves_like
'
add
on form data'
,
'#js-buy-minutes'
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