From 68bb2a53383d79e5e3e38f9894f0ea61c3701f46 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 24 Apr 2017 08:58:15 -0700 Subject: Optimize project namespace lookup for milestones and add specs --- spec/controllers/projects/milestones_controller_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec/controllers/projects/milestones_controller_spec.rb') diff --git a/spec/controllers/projects/milestones_controller_spec.rb b/spec/controllers/projects/milestones_controller_spec.rb index 14207bf6b7a..47e61c3cea8 100644 --- a/spec/controllers/projects/milestones_controller_spec.rb +++ b/spec/controllers/projects/milestones_controller_spec.rb @@ -5,6 +5,7 @@ describe Projects::MilestonesController do let(:user) { create(:user) } let(:milestone) { create(:milestone, project: project) } let(:issue) { create(:issue, project: project, milestone: milestone) } + let!(:label) { create(:label, project: project, title: 'Issue Label', issues: [issue]) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project, milestone: milestone) } before do @@ -13,6 +14,20 @@ describe Projects::MilestonesController do controller.instance_variable_set(:@project, project) end + describe "#show" do + render_views + + def view_milestone + get :show, namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid + end + + it 'shows milestone page' do + view_milestone + + expect(response).to have_http_status(200) + end + end + describe "#destroy" do it "removes milestone" do expect(issue.milestone_id).to eq(milestone.id) -- cgit v1.2.1