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
iv
gitlab-ce
Commits
9cabe043
Commit
9cabe043
authored
Sep 27, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for: Profile -> History
parent
68f4b597
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
0 deletions
+24
-0
app/models/event.rb
app/models/event.rb
+1
-0
features/profile/profile.feature
features/profile/profile.feature
+5
-0
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+8
-0
features/steps/shared/authentication.rb
features/steps/shared/authentication.rb
+4
-0
spec/factories.rb
spec/factories.rb
+6
-0
No files found.
app/models/event.rb
View file @
9cabe043
...
@@ -20,6 +20,7 @@ class Event < ActiveRecord::Base
...
@@ -20,6 +20,7 @@ class Event < ActiveRecord::Base
delegate
:title
,
to: :issue
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :issue
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :merge_request
,
prefix:
true
,
allow_nil:
true
delegate
:title
,
to: :merge_request
,
prefix:
true
,
allow_nil:
true
belongs_to
:author
,
class_name:
"User"
belongs_to
:project
belongs_to
:project
belongs_to
:target
,
polymorphic:
true
belongs_to
:target
,
polymorphic:
true
...
...
features/profile/profile.feature
View file @
9cabe043
...
@@ -20,3 +20,8 @@ Feature: Profile
...
@@ -20,3 +20,8 @@ Feature: Profile
Given
I visit profile account page
Given
I visit profile account page
Then
I reset my token
Then
I reset my token
And
I should see new token
And
I should see new token
Scenario
:
I
visit history tab
Given
I have activity
When
I visit profile history page
Then
I should see my activity
features/steps/profile/profile.rb
View file @
9cabe043
...
@@ -41,4 +41,12 @@ class Profile < Spinach::FeatureSteps
...
@@ -41,4 +41,12 @@ class Profile < Spinach::FeatureSteps
find
(
"#token"
).
value
.
should_not
==
@old_token
find
(
"#token"
).
value
.
should_not
==
@old_token
find
(
"#token"
).
value
.
should
==
@user
.
reload
.
private_token
find
(
"#token"
).
value
.
should
==
@user
.
reload
.
private_token
end
end
Given
'I have activity'
do
Factory
:closed_issue_event
,
author:
current_user
end
Then
'I should see my activity'
do
page
.
should
have_content
"
#{
current_user
.
name
}
closed issue"
end
end
end
features/steps/shared/authentication.rb
View file @
9cabe043
...
@@ -11,4 +11,8 @@ module SharedAuthentication
...
@@ -11,4 +11,8 @@ module SharedAuthentication
Given
'I sign in as an admin'
do
Given
'I sign in as an admin'
do
login_as
:admin
login_as
:admin
end
end
def
current_user
@user
||
User
.
first
end
end
end
spec/factories.rb
View file @
9cabe043
...
@@ -78,6 +78,12 @@ FactoryGirl.define do
...
@@ -78,6 +78,12 @@ FactoryGirl.define do
end
end
factory
:event
do
factory
:event
do
factory
:closed_issue_event
do
project
action
Event
::
Closed
target
factory: :closed_issue
author
factory: :user
end
end
end
factory
:key
do
factory
:key
do
...
...
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