Commit 9cabe043 authored by randx's avatar randx

tests for: Profile -> History

parent 68f4b597
......@@ -20,6 +20,7 @@ class Event < ActiveRecord::Base
delegate :title, to: :issue, 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 :target, polymorphic: true
......
......@@ -20,3 +20,8 @@ Feature: Profile
Given I visit profile account page
Then I reset my 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
......@@ -41,4 +41,12 @@ class Profile < Spinach::FeatureSteps
find("#token").value.should_not == @old_token
find("#token").value.should == @user.reload.private_token
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
......@@ -11,4 +11,8 @@ module SharedAuthentication
Given 'I sign in as an admin' do
login_as :admin
end
def current_user
@user || User.first
end
end
......@@ -78,6 +78,12 @@ FactoryGirl.define do
end
factory :event do
factory :closed_issue_event do
project
action Event::Closed
target factory: :closed_issue
author factory: :user
end
end
factory :key do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment