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
26df51dc
Commit
26df51dc
authored
Apr 14, 2016
by
Sebastian Klier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test to conform to conventions
parent
39a545d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
spec/models/project_services/slack_service/wiki_page_message_spec.rb
.../project_services/slack_service/wiki_page_message_spec.rb
+8
-7
No files found.
spec/models/project_services/slack_service/wiki_page_message_spec.rb
View file @
26df51dc
require
'spec_helper'
describe
SlackService
::
WikiPageMessage
,
models:
true
do
subject
{
SlackService
::
WikiPageMessage
.
new
(
args
)
}
subject
{
described_class
.
new
(
args
)
}
let
(
:args
)
do
{
...
...
@@ -19,13 +19,11 @@ describe SlackService::WikiPageMessage, models: true do
}
end
let
(
:color
)
{
'#345'
}
describe
'#pretext'
do
context
'when :action == "create"'
do
before
{
args
[
:object_attributes
][
:action
]
=
'create'
}
it
do
it
'returns a message that a new wiki page was created'
do
expect
(
subject
.
pretext
).
to
eq
(
'Test User created <url|wiki page> in <somewhere.com|project_name>: '
\
'*Wiki page title*'
)
...
...
@@ -35,7 +33,7 @@ describe SlackService::WikiPageMessage, models: true do
context
'when :action == "update"'
do
before
{
args
[
:object_attributes
][
:action
]
=
'update'
}
it
do
it
'returns a message that a wiki page was updated'
do
expect
(
subject
.
pretext
).
to
eq
(
'Test User edited <url|wiki page> in <somewhere.com|project_name>: '
\
'*Wiki page title*'
)
...
...
@@ -44,10 +42,13 @@ describe SlackService::WikiPageMessage, models: true do
end
describe
'#attachments'
do
let
(
:color
)
{
'#345'
}
context
'when :action == "create"'
do
before
{
args
[
:object_attributes
][
:action
]
=
'create'
}
it
do
it
'it returns the attachment for a new wiki page'
do
expect
(
subject
.
attachments
).
to
eq
([
{
text:
"Wiki page description"
,
...
...
@@ -60,7 +61,7 @@ describe SlackService::WikiPageMessage, models: true do
context
'when :action == "update"'
do
before
{
args
[
:object_attributes
][
:action
]
=
'update'
}
it
do
it
'it returns the attachment for an updated wiki page'
do
expect
(
subject
.
attachments
).
to
eq
([
{
text:
"Wiki page description"
,
...
...
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