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
b96af79b
Commit
b96af79b
authored
Jun 12, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for last push widget
parent
e0d1fba1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
3 deletions
+57
-3
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+1
-0
app/views/events/_event_last_push.html.haml
app/views/events/_event_last_push.html.haml
+4
-3
spec/requests/last_push_widget_spec.rb
spec/requests/last_push_widget_spec.rb
+52
-0
No files found.
app/assets/stylesheets/common.scss
View file @
b96af79b
...
@@ -745,4 +745,5 @@ li.note {
...
@@ -745,4 +745,5 @@ li.note {
border-style
:
solid
;
border-style
:
solid
;
border-width
:
1px
;
border-width
:
1px
;
@include
border-radius
(
4px
);
@include
border-radius
(
4px
);
min-height
:
42px
;
}
}
app/views/events/_event_last_push.html.haml
View file @
b96af79b
-
if
event
&&
event
.
branch_name
&&
event
.
project
.
merge_requests_enabled
-
if
event
&&
event
.
branch_name
.event_lp
.event_lp
%div
%div
=
image_tag
gravatar_icon
(
event
.
author_email
),
:class
=>
"avatar"
=
image_tag
gravatar_icon
(
event
.
author_email
),
:class
=>
"avatar"
...
@@ -12,5 +12,6 @@
...
@@ -12,5 +12,6 @@
=
time_ago_in_words
(
event
.
created_at
)
=
time_ago_in_words
(
event
.
created_at
)
ago.
ago.
=
link_to
new_mr_path_from_push_event
(
event
),
:title
=>
"New Merge Request"
,
:class
=>
"btn small padded primary"
do
-
if
event
.
project
.
merge_requests_enabled
Merge Request
=
link_to
new_mr_path_from_push_event
(
event
),
:title
=>
"New Merge Request"
,
:class
=>
"btn small padded primary"
do
Create Merge Request
spec/requests/last_push_widget_spec.rb
0 → 100644
View file @
b96af79b
require
'spec_helper'
describe
"Last Push widget"
do
before
{
login_as
:user
}
before
do
@project
=
Factory
:project
,
:owner
=>
@user
@project
.
add_access
(
@user
,
:read
)
create_push_event
visit
projects_path
end
it
"should display last push widget with link to merge request page"
do
page
.
should
have_content
"Your last push was to branch new_design"
page
.
should
have_link
"Create Merge Request"
end
describe
"click create MR"
do
before
{
click_link
"Create Merge Request"
}
it
{
current_path
.
should
==
new_project_merge_request_path
(
@project
)
}
it
{
find
(
"#merge_request_source_branch"
).
value
.
should
==
"new_design"
}
it
{
find
(
"#merge_request_target_branch"
).
value
.
should
==
"master"
}
it
{
find
(
"#merge_request_title"
).
value
.
should
==
"
\n
New Design"
}
end
def
create_push_event
data
=
{
:before
=>
"0000000000000000000000000000000000000000"
,
:after
=>
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
:ref
=>
"refs/heads/new_design"
,
:user_id
=>
@user
.
id
,
:user_name
=>
@user
.
name
,
:repository
=>
{
:name
=>
@project
.
name
,
:url
=>
"localhost/rubinius"
,
:description
=>
""
,
:homepage
=>
"localhost/rubinius"
,
:private
=>
true
}
}
@event
=
Event
.
create
(
:project
=>
@project
,
:action
=>
Event
::
Pushed
,
:data
=>
data
,
:author_id
=>
@user
.
id
)
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