diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-22 21:14:42 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-22 21:14:42 +0300 |
commit | 20a12438ab470afe1a5736fc46091a6ef4c30073 (patch) | |
tree | 11a74e4f4bfb2d06835d8832f6374ea887b8bf3c /spec/controllers/users_controller_spec.rb | |
parent | 9c6086bc956a3fa57cb71eab744847b0206109e2 (diff) |
Fix user controller specs
Diffstat (limited to 'spec/controllers/users_controller_spec.rb')
-rw-r--r-- | spec/controllers/users_controller_spec.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 7962bcdde71..d47a37914df 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -25,34 +25,21 @@ describe UsersController do end describe 'GET #calendar_activities' do - include RepoHelpers - let(:project) { create(:project) } - let(:calendar_user) { create(:user, email: sample_commit.author_email) } - let(:commit1) { '0ed8c6c6752e8c6ea63e7b92a517bf5ac1209c80' } - let(:commit2) { '7d3b0f7cff5f37573aea97cebfd5692ea1689924' } + let!(:project) { create(:project) } + let!(:user) { create(:user) } before do allow_any_instance_of(User).to receive(:contributed_projects_ids).and_return([project.id]) project.team << [user, :developer] end - it 'assigns @commit_count' do - get :calendar_activities, username: calendar_user.username, date: '2014-07-31' - expect(assigns(:commit_count)).to eq(2) - end - it 'assigns @calendar_date' do - get :calendar_activities, username: calendar_user.username, date: '2014-07-31' + get :calendar_activities, username: user.username, date: '2014-07-31' expect(assigns(:calendar_date)).to eq(Date.parse('2014-07-31')) end - it 'assigns @calendar_activities' do - get :calendar_activities, username: calendar_user.username, date: '2014-07-31' - expect(assigns(:calendar_activities).values.flatten.map(&:id)).to eq([commit1, commit2]) - end - it 'renders calendar_activities' do - get :calendar_activities, username: calendar_user.username + get :calendar_activities, username: user.username expect(response).to render_template('calendar_activities') end end |