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
Tatuya Kamada
gitlab-ce
Commits
bf6b1078
Commit
bf6b1078
authored
Dec 13, 2016
by
jurre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move admin broadcast messages spinach feature to rspec
parent
60f61096
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
33 deletions
+51
-33
features/admin/broadcast_messages.feature
features/admin/broadcast_messages.feature
+0
-33
spec/features/admin/admin_broadcast_messages_spec.rb
spec/features/admin/admin_broadcast_messages_spec.rb
+51
-0
No files found.
features/admin/broadcast_messages.feature
deleted
100644 → 0
View file @
60f61096
@admin
Feature
:
Admin Broadcast Messages
Background
:
Given
I sign in as an admin
And
application already has a broadcast message
And
I visit admin messages page
Scenario
:
See broadcast messages list
Then
I should see all broadcast messages
Scenario
:
Create a customized broadcast message
When
submit form with new customized broadcast message
Then
I should be redirected to admin messages page
And
I should see newly created broadcast message
Then
I visit dashboard page
And
I should see a customized broadcast message
Scenario
:
Edit an existing broadcast message
When
I edit an existing broadcast message
And
I change the broadcast message text
Then
I should be redirected to admin messages page
And
I should see the updated broadcast message
Scenario
:
Remove an existing broadcast message
When
I remove an existing broadcast message
Then
I should be redirected to admin messages page
And
I should not see the removed broadcast message
@javascript
Scenario
:
Live preview a customized broadcast message
When
I visit admin messages page
And
I enter a broadcast message with Markdown
Then
I should see a live preview of the rendered broadcast message
features/steps/admin/broadcast_messages
.rb
→
spec/features/admin/admin_broadcast_messages_spec
.rb
View file @
bf6b1078
class
Spinach::Features::AdminBroadcastMessages
<
Spinach
::
FeatureSteps
require
'spec_helper'
include
SharedAuthentication
include
SharedPaths
step
'application already has a broadcast message'
do
feature
'Admin Broadcast Messages'
,
feature:
true
do
FactoryGirl
.
create
(
:broadcast_message
,
:expired
,
message:
"Migration to new server"
)
before
do
login_as
:admin
create
(
:broadcast_message
,
:expired
,
message:
'Migration to new server'
)
visit
admin_broadcast_messages_path
end
end
s
tep
'I should see all broadcast messages
'
do
s
cenario
'See broadcast messages list
'
do
expect
(
page
).
to
have_content
"Migration to new server"
expect
(
page
).
to
have_content
'Migration to new server'
end
end
step
'I should be redirected to admin messages page'
do
scenario
'Create a customized broadcast message'
do
expect
(
current_path
).
to
eq
admin_broadcast_messages_path
end
step
'I should see newly created broadcast message'
do
expect
(
page
).
to
have_content
'Application update from 4:00 CST to 5:00 CST'
end
step
'submit form with new customized broadcast message'
do
fill_in
'broadcast_message_message'
,
with:
'Application update from **4:00 CST to 5:00 CST**'
fill_in
'broadcast_message_message'
,
with:
'Application update from **4:00 CST to 5:00 CST**'
fill_in
'broadcast_message_color'
,
with:
'#f2dede'
fill_in
'broadcast_message_color'
,
with:
'#f2dede'
fill_in
'broadcast_message_font'
,
with:
'#b94a48'
fill_in
'broadcast_message_font'
,
with:
'#b94a48'
select
Date
.
today
.
next_year
.
year
,
from:
"broadcast_message_ends_at_1i"
select
Date
.
today
.
next_year
.
year
,
from:
'broadcast_message_ends_at_1i'
click_button
"Add broadcast message"
click_button
'Add broadcast message'
end
step
'I should see a customized broadcast message'
do
expect
(
current_path
).
to
eq
admin_broadcast_messages_path
expect
(
page
).
to
have_content
'Application update from 4:00 CST to 5:00 CST'
expect
(
page
).
to
have_content
'Application update from 4:00 CST to 5:00 CST'
expect
(
page
).
to
have_selector
'strong'
,
text:
'4:00 CST to 5:00 CST'
expect
(
page
).
to
have_selector
'strong'
,
text:
'4:00 CST to 5:00 CST'
expect
(
page
).
to
have_selector
%(div[style="background-color: #f2dede; color: #b94a48"])
expect
(
page
).
to
have_selector
%(div[style="background-color: #f2dede; color: #b94a48"])
end
end
s
tep
'I e
dit an existing broadcast message'
do
s
cenario
'E
dit an existing broadcast message'
do
click_link
'Edit'
click_link
'Edit'
end
step
'I change the broadcast message text'
do
fill_in
'broadcast_message_message'
,
with:
'Application update RIGHT NOW'
fill_in
'broadcast_message_message'
,
with:
'Application update RIGHT NOW'
click_button
'Update broadcast message'
click_button
'Update broadcast message'
end
step
'I should see the updated broadcast message'
do
expect
(
current_path
).
to
eq
admin_broadcast_messages_path
expect
(
page
).
to
have_content
"Application update RIGHT NOW"
expect
(
page
).
to
have_content
'Application update RIGHT NOW'
end
end
s
tep
'I r
emove an existing broadcast message'
do
s
cenario
'R
emove an existing broadcast message'
do
click_link
'Remove'
click_link
'Remove'
end
step
'I should not see the removed broadcast message'
do
expect
(
current_path
).
to
eq
admin_broadcast_messages_path
expect
(
page
).
not_to
have_content
'Migration to new server'
expect
(
page
).
not_to
have_content
'Migration to new server'
end
end
s
tep
'I enter a broadcast message with Markdown'
do
s
cenario
'Live preview a customized broadcast message'
,
js:
true
do
fill_in
'broadcast_message_message'
,
with:
"Live **Markdown** previews. :tada:"
fill_in
'broadcast_message_message'
,
with:
"Live **Markdown** previews. :tada:"
end
step
'I should see a live preview of the rendered broadcast message'
do
page
.
within
(
'.broadcast-message-preview'
)
do
page
.
within
(
'.broadcast-message-preview'
)
do
expect
(
page
).
to
have_selector
(
'strong'
,
text:
'Markdown'
)
expect
(
page
).
to
have_selector
(
'strong'
,
text:
'Markdown'
)
expect
(
page
).
to
have_selector
(
'img.emoji'
)
expect
(
page
).
to
have_selector
(
'img.emoji'
)
...
...
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