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
5c0946b0
Commit
5c0946b0
authored
Dec 03, 2019
by
Francisco Javier López
Committed by
Denys Mishunov
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed feature spec
parent
4ded17fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
spec/features/snippets_spec.rb
spec/features/snippets_spec.rb
+16
-19
No files found.
spec/features/snippets_spec.rb
View file @
5c0946b0
...
@@ -6,41 +6,38 @@ describe 'Snippets' do
...
@@ -6,41 +6,38 @@ describe 'Snippets' do
context
'when the project has snippets'
do
context
'when the project has snippets'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:snippets
)
{
create_list
(
:project_snippet
,
2
,
:public
,
author:
project
.
owner
,
project:
project
)
}
let!
(
:snippets
)
{
create_list
(
:project_snippet
,
2
,
:public
,
author:
project
.
owner
,
project:
project
)
}
before
do
before
do
allow
(
Snippet
).
to
receive
(
:default_per_page
).
and_return
(
1
)
allow
(
Snippet
).
to
receive
(
:default_per_page
).
and_return
(
1
)
visit
snippets_path
(
username:
project
.
owner
.
username
)
visit
project_snippets_path
(
project
)
end
end
it_behaves_like
'paginated snippets'
it_behaves_like
'paginated snippets'
end
end
describe
'
when feature flag is enabled
'
do
describe
'
rendering engine
'
do
let
(
:user
)
{
create
(
:user
)
}
let
_it_be
(
:snippet
)
{
create
(
:personal_snippet
,
:public
)
}
let
!
(
:snippets
)
{
create
(
:personal_snippet
,
:public
,
author:
user
)
}
let
(
:snippets_vue_feature_flag_enabled
)
{
true
}
before
do
before
do
stub_feature_flags
(
snippets_vue:
true
)
stub_feature_flags
(
snippets_vue:
snippets_vue_feature_flag_enabled
)
visit
snippet_path
(
1
)
visit
snippet_path
(
snippet
)
end
end
it
'
should render
Vue application'
do
it
'
renders
Vue application'
do
expect
(
page
).
to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
not_to
have_selector
(
'.personal-snippets'
)
expect
(
page
).
not_to
have_selector
(
'.personal-snippets'
)
end
end
end
describe
'when feature flag is disabled'
do
context
'when feature flag is disabled'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:snippets_vue_feature_flag_enabled
)
{
false
}
let!
(
:snippets
)
{
create
(
:personal_snippet
,
:public
,
author:
user
)
}
before
do
stub_feature_flags
(
snippets_vue:
false
)
visit
snippet_path
(
1
)
end
it
'should render HAML application and not Vue'
do
it
'renders HAML application and not Vue'
do
expect
(
page
).
not_to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
not_to
have_selector
(
'#js-snippet-view'
)
expect
(
page
).
to
have_selector
(
'.personal-snippets'
)
expect
(
page
).
to
have_selector
(
'.personal-snippets'
)
end
end
end
end
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