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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
5bc42660
Commit
5bc42660
authored
Oct 24, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test login tab/pane rendering in varying configurations.
parent
413c012d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
spec/features/login_spec.rb
spec/features/login_spec.rb
+63
-0
No files found.
spec/features/login_spec.rb
View file @
5bc42660
...
...
@@ -215,4 +215,67 @@ feature 'Login', feature: true do
end
end
end
describe
'UI tabs and panes'
do
context
'when no defaults are changed'
do
it
'should correctly render tabs and panes'
do
ensure_tab_pane_correctness
end
end
context
'when signup is disabled'
do
before
do
stub_application_setting
(
signup_enabled:
false
)
end
it
'should correctly render tabs and panes'
do
ensure_tab_pane_correctness
end
end
context
'when ldap is enabled'
do
before
do
visit
new_user_session_path
allow
(
page
).
to
receive
(
:form_based_providers
).
and_return
([
:ldapmain
])
allow
(
page
).
to
receive
(
:ldap_enabled
).
and_return
(
true
)
end
it
'should correctly render tabs and panes'
do
ensure_tab_pane_correctness
(
false
)
end
end
context
'when crowd is enabled'
do
before
do
visit
new_user_session_path
allow
(
page
).
to
receive
(
:form_based_providers
).
and_return
([
:crowd
])
allow
(
page
).
to
receive
(
:crowd_enabled?
).
and_return
(
true
)
end
it
'tabs and panes should be configured correctly'
do
ensure_tab_pane_correctness
(
false
)
end
end
def
ensure_tab_pane_correctness
(
visit_path
=
true
)
if
visit_path
visit
new_user_session_path
end
ensure_tab_pane_counts
ensure_one_active_tab
ensure_one_active_pane
end
def
ensure_tab_pane_counts
tabs_count
=
page
.
all
(
'[role="tab"]'
).
size
expect
(
page
).
to
have_selector
(
'[role="tabpanel"]'
,
count:
tabs_count
)
end
def
ensure_one_active_tab
expect
(
page
).
to
have_selector
(
'.nav-tabs > li.active'
,
count:
1
)
end
def
ensure_one_active_pane
expect
(
page
).
to
have_selector
(
'.tab-pane.active'
,
count:
1
)
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