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
8086b2bd
Commit
8086b2bd
authored
Dec 31, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify BroadcastMessage factory
Also make the feature tests less brittle.
parent
12903762
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
features/admin/broadcast_messages.feature
features/admin/broadcast_messages.feature
+1
-1
features/steps/admin/broadcast_messages.rb
features/steps/admin/broadcast_messages.rb
+3
-4
spec/factories/broadcast_messages.rb
spec/factories/broadcast_messages.rb
+7
-6
No files found.
features/admin/broadcast_messages.feature
View file @
8086b2bd
...
...
@@ -6,7 +6,7 @@ Feature: Admin Broadcast Messages
And
I visit admin messages page
Scenario
:
See broadcast messages list
Then
I should
b
e all broadcast messages
Then
I should
se
e all broadcast messages
Scenario
:
Create a broadcast message
When
submit form with new broadcast message
...
...
features/steps/admin/broadcast_messages.rb
View file @
8086b2bd
...
...
@@ -4,10 +4,10 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
include
SharedAdmin
step
'application already has admin messages'
do
FactoryGirl
.
create
(
:broadcast_message
,
message:
"Migration to new server"
)
FactoryGirl
.
create
(
:broadcast_message
,
:expired
,
message:
"Migration to new server"
)
end
step
'I should
b
e all broadcast messages'
do
step
'I should
se
e all broadcast messages'
do
expect
(
page
).
to
have_content
"Migration to new server"
end
...
...
@@ -27,10 +27,9 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
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'
click_link
"Customize colors"
fill_in
'broadcast_message_color'
,
with:
'#f2dede'
fill_in
'broadcast_message_font'
,
with:
'#b94a48'
select
'2018'
,
from:
"broadcast_message_ends_at_1i"
select
Date
.
today
.
next_year
.
year
,
from:
"broadcast_message_ends_at_1i"
click_button
"Add broadcast message"
end
...
...
spec/factories/broadcast_messages.rb
View file @
8086b2bd
...
...
@@ -6,7 +6,6 @@
# message :text not null
# starts_at :datetime
# ends_at :datetime
# alert_type :integer
# created_at :datetime
# updated_at :datetime
# color :string(255)
...
...
@@ -18,10 +17,12 @@
FactoryGirl
.
define
do
factory
:broadcast_message
do
message
"MyText"
starts_at
"2013-11-12 13:43:25"
ends_at
"2013-11-12 13:43:25"
alert_type
1
color
"#555555"
font
"#BBBBBB"
starts_at
Date
.
today
ends_at
Date
.
tomorrow
trait
:expired
do
starts_at
5
.
days
.
ago
ends_at
3
.
days
.
ago
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