2016-06-02 11:05:42 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
describe 'Dashboard > Milestones' do
|
2016-06-02 11:05:42 +05:30
|
|
|
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-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project, namespace: user.namespace) }
|
2016-06-02 11:05:42 +05:30
|
|
|
let!(:milestone) { create(:milestone, project: project) }
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2016-06-02 11:05:42 +05:30
|
|
|
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
|