2016-03-23 06:39:58 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Dashboard > Milestones' do
|
2016-03-23 06:39:58 -04:00
|
|
|
describe 'as anonymous user' do
|
|
|
|
before do
|
|
|
|
visit dashboard_milestones_path
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'is redirected to sign-in page' do
|
|
|
|
expect(current_path).to eq new_user_session_path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'as logged-in user' do
|
|
|
|
let(:user) { create(:user) }
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project, namespace: user.namespace) }
|
2016-03-23 06:39:58 -04:00
|
|
|
let!(:milestone) { create(:milestone, project: project) }
|
|
|
|
before do
|
2017-12-22 03:18:28 -05:00
|
|
|
project.add_master(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2016-03-23 06:39:58 -04:00
|
|
|
visit dashboard_milestones_path
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'sees milestones' do
|
|
|
|
expect(current_path).to eq dashboard_milestones_path
|
|
|
|
expect(page).to have_content(milestone.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|