diff options
author | James Lopez <james@jameslopez.es> | 2016-02-22 17:46:29 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-02-22 17:46:29 +0300 |
commit | 303e9eb5bfa528e5df3f8b3e76596b2d4401acf4 (patch) | |
tree | 220f33dd9cd33db784dc32a2e68a8971e7f16192 /spec/controllers/users_controller_spec.rb | |
parent | 5803a5308f5a7a84cc84dd0a7d8a89565bae0717 (diff) |
include contributions from forked projects on profile calendar
Diffstat (limited to 'spec/controllers/users_controller_spec.rb')
-rw-r--r-- | spec/controllers/users_controller_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 104a5f50143..7337ff58be1 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -41,6 +41,7 @@ describe UsersController do end describe 'GET #calendar' do + it 'renders calendar' do sign_in(user) @@ -48,6 +49,23 @@ describe UsersController do expect(response).to render_template('calendar') end + + context 'forked project' do + let!(:project) { create(:project) } + let!(:forked_project) { Projects::ForkService.new(project, user).execute } + + before do + sign_in(user) + project.team << [user, :developer] + EventCreateService.new.push(project, user, []) + EventCreateService.new.push(forked_project, user, []) + end + + it 'includes forked projects' do + get :calendar, username: user.username + expect(assigns(:contributions_calendar).projects.count).to eq(2) + end + end end describe 'GET #calendar_activities' do |