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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
944f08a0
Commit
944f08a0
authored
May 03, 2017
by
Douglas Barbosa Alexandre
Committed by
Robert Speicher
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename create_event to create_push_event on event spec
parent
9b97be8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
spec/models/event_spec.rb
spec/models/event_spec.rb
+6
-6
No files found.
spec/models/event_spec.rb
View file @
944f08a0
...
@@ -21,7 +21,7 @@ describe Event, models: true do
...
@@ -21,7 +21,7 @@ describe Event, models: true do
it
'calls the reset_project_activity method'
do
it
'calls the reset_project_activity method'
do
expect_any_instance_of
(
described_class
).
to
receive
(
:reset_project_activity
)
expect_any_instance_of
(
described_class
).
to
receive
(
:reset_project_activity
)
create_event
(
project
,
project
.
owner
)
create_
push_
event
(
project
,
project
.
owner
)
end
end
end
end
end
end
...
@@ -29,7 +29,7 @@ describe Event, models: true do
...
@@ -29,7 +29,7 @@ describe Event, models: true do
describe
"Push event"
do
describe
"Push event"
do
let
(
:project
)
{
create
(
:empty_project
,
:private
)
}
let
(
:project
)
{
create
(
:empty_project
,
:private
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:user
)
{
project
.
owner
}
let
(
:event
)
{
create_event
(
project
,
user
)
}
let
(
:event
)
{
create_
push_
event
(
project
,
user
)
}
it
do
it
do
expect
(
event
.
push?
).
to
be_truthy
expect
(
event
.
push?
).
to
be_truthy
...
@@ -246,7 +246,7 @@ describe Event, models: true do
...
@@ -246,7 +246,7 @@ describe Event, models: true do
expect
(
project
).
not_to
receive
(
:update_column
).
expect
(
project
).
not_to
receive
(
:update_column
).
with
(
:last_repository_updated_at
,
a_kind_of
(
Time
))
with
(
:last_repository_updated_at
,
a_kind_of
(
Time
))
create_event
(
project
,
project
.
owner
)
create_
push_
event
(
project
,
project
.
owner
)
end
end
end
end
...
@@ -255,7 +255,7 @@ describe Event, models: true do
...
@@ -255,7 +255,7 @@ describe Event, models: true do
it
'updates the project last_activity_at and last_repository_updated_at'
do
it
'updates the project last_activity_at and last_repository_updated_at'
do
project
.
update
(
last_activity_at:
1
.
year
.
ago
,
last_repository_updated_at:
1
.
year
.
ago
)
project
.
update
(
last_activity_at:
1
.
year
.
ago
,
last_repository_updated_at:
1
.
year
.
ago
)
create_event
(
project
,
project
.
owner
)
create_
push_
event
(
project
,
project
.
owner
)
project
.
reload
project
.
reload
...
@@ -265,7 +265,7 @@ describe Event, models: true do
...
@@ -265,7 +265,7 @@ describe Event, models: true do
end
end
context
'without a push event'
do
context
'without a push event'
do
it
'does not update
s
the project last_repository_updated_at'
do
it
'does not update the project last_repository_updated_at'
do
project
.
update
(
last_activity_at:
1
.
year
.
ago
,
last_repository_updated_at:
1
.
year
.
ago
)
project
.
update
(
last_activity_at:
1
.
year
.
ago
,
last_repository_updated_at:
1
.
year
.
ago
)
create
(
:closed_issue_event
,
project:
project
,
author:
project
.
owner
)
create
(
:closed_issue_event
,
project:
project
,
author:
project
.
owner
)
...
@@ -297,7 +297,7 @@ describe Event, models: true do
...
@@ -297,7 +297,7 @@ describe Event, models: true do
end
end
end
end
def
create_event
(
project
,
user
,
attrs
=
{})
def
create_
push_
event
(
project
,
user
,
attrs
=
{})
data
=
{
data
=
{
before:
Gitlab
::
Git
::
BLANK_SHA
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
...
...
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