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
ab0b0a5d
Commit
ab0b0a5d
authored
Aug 07, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing Test for on Premise
parent
24ee0715
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
app/helpers/license_helper.rb
app/helpers/license_helper.rb
+2
-2
app/views/shared/promotions/_promotion_link_project.html.haml
...views/shared/promotions/_promotion_link_project.html.haml
+1
-1
spec/features/promotion_spec.rb
spec/features/promotion_spec.rb
+7
-6
No files found.
app/helpers/license_helper.rb
View file @
ab0b0a5d
...
@@ -68,9 +68,9 @@ module LicenseHelper
...
@@ -68,9 +68,9 @@ module LicenseHelper
end
end
def
upgrade_plan_url
def
upgrade_plan_url
if
(
@project
.
owner
.
present?
&&
@project
.
owner
==
@current_user
)
if
@project
.
owner
.
present?
&&
@project
.
owner
==
@current_user
profile_billings_path
profile_billings_path
else
@project
.
group
&
.
has_owner?
(
@current_user
)
else
group_billings_path
(
@project
.
group
)
group_billings_path
(
@project
.
group
)
end
end
end
end
...
...
app/views/shared/promotions/_promotion_link_project.html.haml
View file @
ab0b0a5d
=
current_application_settings
.
should_check_namespace_plan?
-
if
current_application_settings
.
should_check_namespace_plan?
-
if
current_application_settings
.
should_check_namespace_plan?
-
if
(
@project
.
owner
.
present?
&&
@project
.
owner
==
@current_user
)
||
@project
.
group
&
.
has_owner?
(
@current_user
)
-
if
(
@project
.
owner
.
present?
&&
@project
.
owner
==
@current_user
)
||
@project
.
group
&
.
has_owner?
(
@current_user
)
=
link_to
'Upgrade your plan'
,
upgrade_plan_url
,
class:
'btn btn-primary'
=
link_to
'Upgrade your plan'
,
upgrade_plan_url
,
class:
'btn btn-primary'
...
@@ -7,7 +8,6 @@
...
@@ -7,7 +8,6 @@
-
owner
=
@project
.
namespace
.
owner
-
owner
=
@project
.
namespace
.
owner
%p
Contact owner
#{
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
))
}
to upgrade the license.
%p
Contact owner
#{
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
))
}
to upgrade the license.
-
elsif
current_user
.
admin?
-
elsif
current_user
.
admin?
=
'URL '
+
upgrade_plan_url
-
if
License
.
current
&
.
expired?
-
if
License
.
current
&
.
expired?
=
link_to
'Buy GitLab Enterprise Edition'
,
Gitlab
::
SUBSCRIPTIONS_PLANS_URL
,
class:
'btn btn-primary'
=
link_to
'Buy GitLab Enterprise Edition'
,
Gitlab
::
SUBSCRIPTIONS_PLANS_URL
,
class:
'btn btn-primary'
-
else
-
else
...
...
spec/features/promotion_spec.rb
View file @
ab0b0a5d
...
@@ -4,15 +4,15 @@ describe 'Promotions', js: true do
...
@@ -4,15 +4,15 @@ describe 'Promotions', js: true do
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:developer
)
{
create
(
:user
)
}
let
(
:developer
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
path:
'gitlab'
,
name:
'sample'
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
path:
'gitlab'
,
name:
'sample'
)
}
describe
'if you have a license'
do
describe
'if you have a license'
do
before
do
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
end
end
it
'should show no promotion at all'
do
it
'should show no promotion at all'
do
sign_in
(
user
)
visit
edit_project_path
(
project
)
visit
edit_project_path
(
project
)
expect
(
page
).
not_to
have_selector
(
'#promote_service_desk'
)
expect
(
page
).
not_to
have_selector
(
'#promote_service_desk'
)
end
end
...
@@ -22,6 +22,7 @@ describe 'Promotions', js: true do
...
@@ -22,6 +22,7 @@ describe 'Promotions', js: true do
context
'no license installed'
do
context
'no license installed'
do
before
do
before
do
License
.
destroy_all
License
.
destroy_all
stub_application_setting
(
check_namespace_plan:
false
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
end
end
...
@@ -39,23 +40,23 @@ describe 'Promotions', js: true do
...
@@ -39,23 +40,23 @@ describe 'Promotions', js: true do
end
end
end
end
describe
'for project features in general
for .com
'
,
js:
true
do
describe
'for project features in general'
,
js:
true
do
context
'for .com'
do
context
'for .com'
do
before
do
before
do
stub_application_setting
(
check_namespace_plan:
true
)
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
project
.
team
<<
[
developer
,
:developer
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
developer
,
:developer
]
end
end
it
'should have the Upgrade your plan button'
do
it
'should have the Upgrade your plan button'
do
sign_in
(
user
)
sign_in
(
user
)
visit
edit_project_path
(
project
)
visit
edit_project_path
(
project
)
expect
(
find
(
'#promote_service_desk'
)).
to
have_content
'Upgrade your plan'
expect
(
find
(
'#promote_service_desk'
)).
to
have_content
'Upgrade your plan'
end
end
it
'should have the contact owner line'
do
it
'should have the contact owner line'
do
sign_in
(
developer
)
sign_in
(
developer
)
visit
edit_project_path
(
project
)
visit
edit_project_path
(
project
)
expect
(
find
(
'#promote_service_desk'
)).
to
have_content
'Contact owner'
expect
(
find
(
'#promote_service_desk'
)).
to
have_content
'Contact owner'
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