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
4979de70
Commit
4979de70
authored
Apr 28, 2021
by
Angelo Gulina
Committed by
Dan Davison
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual Sync: add feature specs
parent
0928d733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
14 deletions
+35
-14
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
...es/admin/cloud_licences/admin_views_cloud_license_spec.rb
+35
-14
No files found.
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
View file @
4979de70
# frozen_string_literal: true
require
"spec_helper"
require
'spec_helper'
RSpec
.
describe
"Admin views Cloud License"
,
:js
do
RSpec
.
describe
'Admin views Cloud License'
,
:js
do
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
stub_application_setting
(
cloud_license_enabled:
true
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
end
License
::
EE_ALL_PLANS
.
each
do
|
plan
|
context
"
#{
plan
}
license"
do
let_it_be
(
:license
)
{
build
(
:license
,
plan:
plan
)
}
context
'Cloud license'
do
let_it_be
(
:license
)
{
create_current_license
(
type:
License
::
CLOUD_LICENSE_TYPE
,
plan:
License
::
ULTIMATE_PLAN
)
}
it
'displays the subscription details'
do
visit
(
admin_cloud_license_path
)
before
do
visit
(
admin_cloud_license_path
)
end
it
'displays the subscription details'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
'Subscription details'
)
expect
(
all
(
"[data-testid='details-label']"
)[
1
]).
to
have_content
(
'Plan:'
)
expect
(
all
(
"[data-testid='details-content']"
)[
1
]).
to
have_content
(
'Ultimate'
)
end
end
it
'succeeds to sync the subscription'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
click_button
(
'Sync subscription details'
)
expect
(
page
).
to
have_content
(
'The subscription details synced successfully'
)
end
end
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
"Subscription details"
)
end
it
'fails to sync the subscription'
do
create_current_license
(
type:
License
::
CLOUD_LICENSE_TYPE
,
plan:
License
::
ULTIMATE_PLAN
,
expires_at:
nil
)
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
click_button
(
'Sync subscription details'
)
expect
(
page
).
to
have_content
(
'You can no longer sync your subscription details with GitLab. Get help for the most common connectivity issues by troubleshooting the activation code'
)
end
end
end
context
"when there is no license"
do
context
'when there is no license'
do
let_it_be
(
:license
)
{
nil
}
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
visit
(
admin_cloud_license_path
)
end
it
"displays a message signaling there is not active subscription"
do
it
'displays a message signaling there is not active subscription'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
"You do not have an active subscription"
)
expect
(
page
).
to
have_content
(
'You do not have an active subscription'
)
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