summaryrefslogtreecommitdiff
path: root/spec/features/projects/activity
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-04-06 14:40:33 +0200
committerRobert Speicher <rspeicher@gmail.com>2018-04-09 18:04:09 -0500
commit2d54dfb25134cbdf5b4f506b69d13241130bc132 (patch)
tree3ba70e41da756ad6f0e9a17925ff5dd9beaa9b8c /spec/features/projects/activity
parentffc9a470a8bf02d6ac97ea1bb00a0a4fab664314 (diff)
downloadgitlab-ce-2d54dfb25134cbdf5b4f506b69d13241130bc132.tar.gz
Migrate features/project/project.feature to RSpec and reorganize several Project feature specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/projects/activity')
-rw-r--r--spec/features/projects/activity/user_sees_activity_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/features/projects/activity/user_sees_activity_spec.rb b/spec/features/projects/activity/user_sees_activity_spec.rb
new file mode 100644
index 00000000000..a1252a13260
--- /dev/null
+++ b/spec/features/projects/activity/user_sees_activity_spec.rb
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+feature 'Projects > Activity > User sees activity' do
+ let(:project) { create(:project, :repository, :public) }
+ let(:user) { project.creator }
+
+ before do
+ event = create(:push_event, project: project, author: user)
+ create(:push_event_payload,
+ event: event,
+ action: :created,
+ commit_to: '6d394385cf567f80a8fd85055db1ab4c5295806f',
+ ref: 'fix',
+ commit_count: 1)
+ visit activity_project_path(project)
+ end
+
+ shared_examples 'push appears in activity' do
+ it 'shows the last push in the activity page', :js do
+ expect(page).to have_content "#{user.name} pushed new branch fix"
+ end
+ end
+
+ context 'when signed in' do
+ before do
+ project.add_developer(user)
+ sign_in(user)
+ end
+
+ it_behaves_like 'push appears in activity'
+ end
+
+ context 'when signed out' do
+ it_behaves_like 'push appears in activity'
+ end
+end