BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8c604c9d
Commit
8c604c9d
authored
Jan 05, 2013
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for notes on wall
parent
1883e083
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
notes_on_wall_spec.rb
spec/requests/notes_on_wall_spec.rb
+86
-0
No files found.
spec/requests/notes_on_wall_spec.rb
0 → 100644
View file @
8c604c9d
require
'spec_helper'
describe
"On the project wall"
,
js:
true
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:commit
)
{
project
.
commit
(
"bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
)
}
before
do
login_as
:user
project
.
add_access
(
@user
,
:read
,
:write
)
visit
wall_project_path
(
project
)
end
subject
{
page
}
describe
"the note form"
do
# main target form creation
it
{
should
have_css
(
".js-main-target-form"
,
visible:
true
,
count:
1
)
}
# button initalization
it
{
within
(
".js-main-target-form"
)
{
should
have_button
(
"Add Comment"
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should_not
have_link
(
"Cancel"
)
}
}
# notifiactions
it
{
within
(
".js-main-target-form"
)
{
should
have_checked_field
(
"Project team"
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should_not
have_checked_field
(
"Commit author"
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should_not
have_unchecked_field
(
"Commit author"
)
}
}
describe
"without text"
do
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-preview-button"
,
visible:
false
)
}
}
end
describe
"with text"
do
before
do
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"This is awesome"
end
end
it
{
within
(
".js-main-target-form"
)
{
should_not
have_css
(
".js-comment-button[disabled]"
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-preview-button"
,
visible:
true
)
}
}
end
describe
"with preview"
do
before
do
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"This is awesome"
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
end
end
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-preview"
,
text:
"This is awesome"
,
visible:
true
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-preview-button"
,
visible:
false
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-edit-button"
,
visible:
true
)
}
}
end
end
describe
"when posting a note"
do
before
do
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"This is awsome!"
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
click_button
"Add Comment"
end
end
# note added
it
{
within
(
".js-main-target-form"
)
{
should
have_content
(
"This is awsome!"
)
}
}
# reset form
it
{
within
(
".js-main-target-form"
)
{
should
have_no_field
(
"note[note]"
,
with:
"This is awesome!"
)
}
}
# return from preview
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-preview"
,
visible:
false
)
}
}
it
{
within
(
".js-main-target-form"
)
{
should
have_css
(
".js-note-text"
,
visible:
true
)
}
}
it
"should be removable"
do
find
(
".js-note-delete"
).
trigger
(
"click"
)
should_not
have_css
(
".note"
)
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