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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
37066267
Commit
37066267
authored
Jun 13, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `page.all` and `page.within` in specs
parent
422236c7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
spec/features/admin/admin_hooks_spec.rb
spec/features/admin/admin_hooks_spec.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+2
-2
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+16
-16
spec/features/search_spec.rb
spec/features/search_spec.rb
+1
-1
No files found.
spec/features/admin/admin_hooks_spec.rb
View file @
37066267
...
@@ -12,7 +12,7 @@ describe "Admin::Hooks", feature: true do
...
@@ -12,7 +12,7 @@ describe "Admin::Hooks", feature: true do
describe
"GET /admin/hooks"
do
describe
"GET /admin/hooks"
do
it
"should be ok"
do
it
"should be ok"
do
visit
admin_root_path
visit
admin_root_path
within
".sidebar-wrapper"
do
page
.
within
".sidebar-wrapper"
do
click_on
"Hooks"
click_on
"Hooks"
end
end
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
...
...
spec/features/issues_spec.rb
View file @
37066267
...
@@ -311,10 +311,10 @@ describe 'Issues', feature: true do
...
@@ -311,10 +311,10 @@ describe 'Issues', feature: true do
end
end
def
first_issue
def
first_issue
all
(
'ul.issues-list li'
).
first
.
text
page
.
all
(
'ul.issues-list li'
).
first
.
text
end
end
def
last_issue
def
last_issue
all
(
'ul.issues-list li'
).
last
.
text
page
.
all
(
'ul.issues-list li'
).
last
.
text
end
end
end
end
spec/features/notes_on_merge_requests_spec.rb
View file @
37066267
...
@@ -22,20 +22,20 @@ describe 'Comments' do
...
@@ -22,20 +22,20 @@ describe 'Comments' do
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
to
eq
(
'Add Comment'
)
to
eq
(
'Add Comment'
)
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_link
(
'Cancel'
)
expect
(
page
).
not_to
have_link
(
'Cancel'
)
end
end
end
end
describe
'with text'
do
describe
'with text'
do
before
do
before
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'This is awesome'
fill_in
'note[note]'
,
with:
'This is awesome'
end
end
end
end
it
'should have enable submit button and preview button'
do
it
'should have enable submit button and preview button'
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
end
end
...
@@ -45,7 +45,7 @@ describe 'Comments' do
...
@@ -45,7 +45,7 @@ describe 'Comments' do
describe
'when posting a note'
do
describe
'when posting a note'
do
before
do
before
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'This is awsome!'
fill_in
'note[note]'
,
with:
'This is awsome!'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
click_button
'Add Comment'
click_button
'Add Comment'
...
@@ -54,11 +54,11 @@ describe 'Comments' do
...
@@ -54,11 +54,11 @@ describe 'Comments' do
it
'should be added and form reset'
do
it
'should be added and form reset'
do
is_expected
.
to
have_content
(
'This is awsome!'
)
is_expected
.
to
have_content
(
'This is awsome!'
)
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible: :hidden
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible: :hidden
)
end
end
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
is_expected
.
to
have_css
(
'.js-note-text'
,
visible:
true
)
is_expected
.
to
have_css
(
'.js-note-text'
,
visible:
true
)
end
end
end
end
...
@@ -66,7 +66,7 @@ describe 'Comments' do
...
@@ -66,7 +66,7 @@ describe 'Comments' do
describe
'when editing a note'
,
js:
true
do
describe
'when editing a note'
,
js:
true
do
it
'should contain the hidden edit form'
do
it
'should contain the hidden edit form'
do
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
end
end
end
end
...
@@ -78,7 +78,7 @@ describe 'Comments' do
...
@@ -78,7 +78,7 @@ describe 'Comments' do
end
end
it
'should show the note edit form and hide the note body'
do
it
'should show the note edit form and hide the note body'
do
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
:css
,
'.note-body > .note-text'
,
visible:
false
)).
not_to
be_visible
expect
(
find
(
:css
,
'.note-body > .note-text'
,
visible:
false
)).
not_to
be_visible
...
@@ -95,12 +95,12 @@ describe 'Comments' do
...
@@ -95,12 +95,12 @@ describe 'Comments' do
#end
#end
it
'appends the edited at time to the note'
do
it
'appends the edited at time to the note'
do
within
(
'.current-note-edit-form'
)
do
page
.
within
(
'.current-note-edit-form'
)
do
fill_in
'note[note]'
,
with:
'Some new content'
fill_in
'note[note]'
,
with:
'Some new content'
find
(
'.btn-save'
).
click
find
(
'.btn-save'
).
click
end
end
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note_edited_ago'
)
is_expected
.
to
have_css
(
'.note_edited_ago'
)
expect
(
find
(
'.note_edited_ago'
).
text
).
expect
(
find
(
'.note_edited_ago'
).
text
).
to
match
(
/less than a minute ago/
)
to
match
(
/less than a minute ago/
)
...
@@ -115,7 +115,7 @@ describe 'Comments' do
...
@@ -115,7 +115,7 @@ describe 'Comments' do
end
end
it
'shows the delete link'
do
it
'shows the delete link'
do
within
(
'.note-attachment'
)
do
page
.
within
(
'.note-attachment'
)
do
is_expected
.
to
have_css
(
'.js-note-attachment-delete'
)
is_expected
.
to
have_css
(
'.js-note-attachment-delete'
)
end
end
end
end
...
@@ -150,7 +150,7 @@ describe 'Comments' do
...
@@ -150,7 +150,7 @@ describe 'Comments' do
it
{
is_expected
.
to
have_css
(
'.js-temp-notes-holder'
)
}
it
{
is_expected
.
to
have_css
(
'.js-temp-notes-holder'
)
}
it
'has .new_note css class'
do
it
'has .new_note css class'
do
within
(
'.js-temp-notes-holder'
)
do
page
.
within
(
'.js-temp-notes-holder'
)
do
expect
(
subject
).
to
have_css
(
'.new_note'
)
expect
(
subject
).
to
have_css
(
'.new_note'
)
end
end
end
end
...
@@ -166,7 +166,7 @@ describe 'Comments' do
...
@@ -166,7 +166,7 @@ describe 'Comments' do
end
end
it
'should be removed when canceled'
do
it
'should be removed when canceled'
do
within
(
".diff-file form[rel$='
#{
line_code
}
']"
)
do
page
.
within
(
".diff-file form[rel$='
#{
line_code
}
']"
)
do
find
(
'.js-close-discussion-note-form'
).
trigger
(
'click'
)
find
(
'.js-close-discussion-note-form'
).
trigger
(
'click'
)
end
end
...
@@ -186,11 +186,11 @@ describe 'Comments' do
...
@@ -186,11 +186,11 @@ describe 'Comments' do
describe
'previewing them separately'
do
describe
'previewing them separately'
do
before
do
before
do
# add two separate texts and trigger previews on both
# add two separate texts and trigger previews on both
within
(
"tr[id='
#{
line_code
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'One comment on line 7'
fill_in
'note[note]'
,
with:
'One comment on line 7'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'Another comment on line 10'
fill_in
'note[note]'
,
with:
'Another comment on line 10'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
...
@@ -199,7 +199,7 @@ describe 'Comments' do
...
@@ -199,7 +199,7 @@ describe 'Comments' do
describe
'posting a note'
do
describe
'posting a note'
do
before
do
before
do
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'Another comment on line 10'
fill_in
'note[note]'
,
with:
'Another comment on line 10'
click_button
(
'Add Comment'
)
click_button
(
'Add Comment'
)
end
end
...
...
spec/features/search_spec.rb
View file @
37066267
...
@@ -7,7 +7,7 @@ describe "Search", feature: true do
...
@@ -7,7 +7,7 @@ describe "Search", feature: true do
@project
.
team
<<
[
@user
,
:reporter
]
@project
.
team
<<
[
@user
,
:reporter
]
visit
search_path
visit
search_path
within
'.search-holder'
do
page
.
within
'.search-holder'
do
fill_in
"search"
,
with:
@project
.
name
[
0
..
3
]
fill_in
"search"
,
with:
@project
.
name
[
0
..
3
]
click_button
"Search"
click_button
"Search"
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