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
5fb4ae23
Commit
5fb4ae23
authored
Jun 08, 2021
by
Angelo Gulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for activating a subscription
parent
9259bfd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
ee/spec/features/admin/subscriptions/admin_views_subscription_spec.rb
...ures/admin/subscriptions/admin_views_subscription_spec.rb
+38
-5
No files found.
ee/spec/features/admin/subscriptions/admin_views_subscription_spec.rb
View file @
5fb4ae23
...
...
@@ -47,14 +47,14 @@ RSpec.describe 'Admin views Subscription', :js do
end
end
context
'with
a legacy licens
e'
do
context
'with
license fil
e'
do
let!
(
:license
)
{
create_current_license
(
cloud_licensing_enabled:
false
,
plan:
License
::
ULTIMATE_PLAN
)
}
before
do
visit
(
admin_subscription_path
)
end
context
'when removing
the a legacy licens
e'
do
context
'when removing
a license fil
e'
do
before
do
accept_alert
do
click_on
'Remove license'
...
...
@@ -68,7 +68,7 @@ RSpec.describe 'Admin views Subscription', :js do
end
end
context
'
activate
another subscription'
do
context
'
when activating
another subscription'
do
before
do
click_button
(
'Enter activation code'
)
end
...
...
@@ -102,7 +102,7 @@ RSpec.describe 'Admin views Subscription', :js do
end
end
context
'w
hen there is no license
'
do
context
'w
ith no active subscription
'
do
let_it_be
(
:license
)
{
nil
}
before
do
...
...
@@ -117,7 +117,40 @@ RSpec.describe 'Admin views Subscription', :js do
end
end
context
'Upload a legacy license'
do
context
'when activating a new subscription'
do
before
do
license
=
create
(
:license
,
data:
create
(
:gitlab_license
,
{
cloud_licensing_enabled:
true
,
plan:
License
::
ULTIMATE_PLAN
}).
export
)
stub_request
(
:post
,
EE
::
SUBSCRIPTIONS_GRAPHQL_URL
)
.
to_return
(
status:
200
,
body:
{
"data"
:
{
"cloudActivationActivate"
:
{
"licenseKey"
:
license
.
data
}
}
}.
to_json
,
headers:
{
'Content-Type'
=>
'application/json'
})
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
fill_activation_form
end
end
it
'shows a successful activation message'
do
expect
(
page
).
to
have_content
(
'Your subscription was successfully activated.'
)
end
it
'shows the subscription details'
do
expect
(
page
).
to
have_content
(
'Subscription details'
)
end
it
'shows the appropriate license type'
do
page
.
within
(
find
(
'[data-testid="subscription-cell-type"]'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
'Cloud license'
)
end
end
end
context
'when uploading a license file'
do
it
'shows a link to upload a license file'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_link
(
'Upload a license file'
,
href:
new_admin_license_path
)
...
...
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