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
Boxiang Sun
gitlab-ce
Commits
5aeaf248
Commit
5aeaf248
authored
Feb 21, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing rspec after upgrade to capybara pt1
parent
2d5096b6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
34 deletions
+56
-34
app/views/snippets/show.html.haml
app/views/snippets/show.html.haml
+1
-1
spec/features/gitlab_flavored_markdown_spec.rb
spec/features/gitlab_flavored_markdown_spec.rb
+16
-8
spec/features/snippets_spec.rb
spec/features/snippets_spec.rb
+1
-1
spec/features/users_spec.rb
spec/features/users_spec.rb
+19
-0
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+19
-24
No files found.
app/views/snippets/show.html.haml
View file @
5aeaf248
...
...
@@ -4,7 +4,7 @@
=
@snippet
.
title
%small
=
@snippet
.
file_name
-
if
can?
(
current_user
,
:admin_snippet
,
@project
)
||
@snippet
.
author
==
current_user
=
link_to
"Edit"
,
edit_project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-small pull-right"
=
link_to
"Edit"
,
edit_project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-small pull-right"
,
title:
'Edit Snippet'
%br
%div
=
render
'blob'
...
...
spec/features/gitlab_flavored_markdown_spec.rb
View file @
5aeaf248
...
...
@@ -169,32 +169,40 @@ describe "Gitlab Flavored Markdown" do
describe
"for notes"
do
it
"should render in commits#show"
,
js:
true
do
visit
project_commit_path
(
project
,
commit
)
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
within
".new_note.js-main-target-form"
do
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
end
page
.
should
have_link
(
"#
#{
issue
.
id
}
"
)
end
it
"should render in issue#show"
,
js:
true
do
visit
project_issue_path
(
project
,
issue
)
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
within
".new_note.js-main-target-form"
do
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
end
page
.
should
have_link
(
"#
#{
issue
.
id
}
"
)
end
it
"should render in merge_request#show"
,
js:
true
do
visit
project_merge_request_path
(
project
,
merge_request
)
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
within
".new_note.js-main-target-form"
do
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
end
page
.
should
have_link
(
"#
#{
issue
.
id
}
"
)
end
it
"should render in projects#wall"
,
js:
true
do
visit
wall_project_path
(
project
)
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
within
".new_note.js-main-target-form"
do
fill_in
"note_note"
,
with:
"see #
#{
issue
.
id
}
"
click_button
"Add Comment"
end
page
.
should
have_link
(
"#
#{
issue
.
id
}
"
)
end
...
...
spec/features/snippets_spec.rb
View file @
5aeaf248
...
...
@@ -72,7 +72,7 @@ describe "Snippets" do
author:
@user
,
project:
project
)
visit
project_snippet_path
(
project
,
@snippet
)
click_link
"Edit"
click_link
"Edit
Snippet
"
end
it
"should open edit page"
do
...
...
spec/features/users_spec.rb
0 → 100644
View file @
5aeaf248
require
'spec_helper'
describe
'Users'
do
describe
"GET /users/sign_up"
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
true
)
end
it
"should create a new user account"
do
visit
new_user_registration_path
fill_in
"user_name"
,
with:
"Name Surname"
fill_in
"user_username"
,
with:
"Great"
fill_in
"user_email"
,
with:
"name@mail.com"
fill_in
"user_password"
,
with:
"password1234"
fill_in
"user_password_confirmation"
,
with:
"password1234"
expect
{
click_button
"Sign up"
}.
to
change
{
User
.
count
}.
by
(
1
)
end
end
end
spec/requests/api/users_spec.rb
View file @
5aeaf248
...
...
@@ -54,32 +54,27 @@ describe Gitlab::API do
end
describe
"GET /users/sign_up"
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
false
)
end
it
"should redirect to sign in page if signup is disabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
302
response
.
should
redirect_to
(
new_user_session_path
)
end
end
context
'enabled'
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
true
)
end
describe
"GET /users/sign_up"
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
true
)
end
it
"should return sign up page if signup is enabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
200
it
"should return sign up page if signup is enabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
200
end
end
it
"should create a new user account"
do
visit
new_user_registration_path
fill_in
"user_name"
,
with:
"Name Surname"
fill_in
"user_username"
,
with:
"Great"
fill_in
"user_email"
,
with:
"name@mail.com"
fill_in
"user_password"
,
with:
"password1234"
fill_in
"user_password_confirmation"
,
with:
"password1234"
expect
{
click_button
"Sign up"
}.
to
change
{
User
.
count
}.
by
(
1
)
context
'disabled'
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
false
)
end
it
"should redirect to sign in page if signup is disabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
302
response
.
should
redirect_to
(
new_user_session_path
)
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