2018-04-06 08:40:33 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Projects > Activity > User sees activity' do
|
2018-04-06 08:40:33 -04:00
|
|
|
let(:project) { create(:project, :repository, :public) }
|
|
|
|
let(:user) { project.creator }
|
2018-09-06 06:07:33 -04:00
|
|
|
let(:issue) { create(:issue, project: project) }
|
2018-04-06 08:40:33 -04:00
|
|
|
|
|
|
|
before do
|
2018-09-06 06:07:33 -04:00
|
|
|
create(:event, :created, project: project, target: issue, author: user)
|
2018-04-06 08:40:33 -04:00
|
|
|
event = create(:push_event, project: project, author: user)
|
|
|
|
create(:push_event_payload,
|
|
|
|
event: event,
|
|
|
|
action: :created,
|
|
|
|
commit_to: '6d394385cf567f80a8fd85055db1ab4c5295806f',
|
|
|
|
ref: 'fix',
|
|
|
|
commit_count: 1)
|
|
|
|
end
|
|
|
|
|
2018-04-09 13:26:29 -04:00
|
|
|
it 'shows the last push in the activity page', :js do
|
2018-09-06 06:07:33 -04:00
|
|
|
visit activity_project_path(project)
|
|
|
|
|
2018-11-06 09:33:42 -05:00
|
|
|
expect(page).to have_content "#{user.name} #{user.to_reference} pushed new branch fix"
|
2018-04-06 08:40:33 -04:00
|
|
|
end
|
2018-09-06 06:07:33 -04:00
|
|
|
|
|
|
|
it 'allows to filter event with the "event_filter=issue" URL param', :js do
|
|
|
|
visit activity_project_path(project, event_filter: 'issue')
|
|
|
|
|
2018-11-06 09:33:42 -05:00
|
|
|
expect(page).not_to have_content "#{user.name} #{user.to_reference} pushed new branch fix"
|
|
|
|
expect(page).to have_content "#{user.name} #{user.to_reference} opened issue #{issue.to_reference}"
|
2018-09-06 06:07:33 -04:00
|
|
|
end
|
2018-04-06 08:40:33 -04:00
|
|
|
end
|