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
4b2ba6cc
Commit
4b2ba6cc
authored
May 28, 2020
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rspec for _button.html.haml
Added tests to test new logic in _button.html.haml
parent
c74f9110
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
spec/views/projects/issues/import_csv/_button.html.haml_spec.rb
...iews/projects/issues/import_csv/_button.html.haml_spec.rb
+38
-0
No files found.
spec/views/projects/issues/import_csv/_button.html.haml_spec.rb
0 → 100644
View file @
4b2ba6cc
# frozen_string_literal: true
require
'spec_helper'
describe
'projects/issues/import_csv/_button'
do
include
Devise
::
Test
::
ControllerHelpers
context
'when the user is not an admin'
do
before
do
render
end
it
'shows a dropdown button to import CSV'
do
expect
(
rendered
).
to
have_text
(
'Import CSV'
)
end
it
'does not show a button to import from Jira'
do
expect
(
rendered
).
not_to
have_text
(
'Import from Jira'
)
end
end
context
'when the user is an admin'
do
before
do
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:project_import_jira_path
).
and_return
(
'import/jira'
)
render
end
it
'shows a dropdown button to import CSV'
do
expect
(
rendered
).
to
have_text
(
'Import CSV'
)
end
it
'shows a button to import from Jira'
do
expect
(
rendered
).
to
have_text
(
'Import from Jira'
)
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