Add missing Dashboard::LabelsController
This commit is contained in:
parent
e989d12b07
commit
ce44e5a787
2 changed files with 38 additions and 0 deletions
9
app/controllers/dashboard/labels_controller.rb
Normal file
9
app/controllers/dashboard/labels_controller.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
class Dashboard::LabelsController < Dashboard::ApplicationController
|
||||||
|
def index
|
||||||
|
labels = Label.where(project_id: projects).select(:title, :color).uniq(:title)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.json { render json: labels }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
29
spec/features/dashboard_milestones_spec.rb
Normal file
29
spec/features/dashboard_milestones_spec.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
feature 'Dashboard > Milestones', feature: true do
|
||||||
|
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) }
|
||||||
|
let(:project) { create(:empty_project, namespace: user.namespace) }
|
||||||
|
let!(:milestone) { create(:milestone, project: project) }
|
||||||
|
before do
|
||||||
|
project.team << [user, :master]
|
||||||
|
login_with(user)
|
||||||
|
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
|
Loading…
Reference in a new issue