Commit 77a98c36 authored by blunceford's avatar blunceford

Cleaned up tests for group milestones

parent baa2d078
...@@ -47,6 +47,8 @@ describe Dashboard::MilestonesController do ...@@ -47,6 +47,8 @@ describe Dashboard::MilestonesController do
describe "#index" do describe "#index" do
let(:public_group) { create(:group, :public) } let(:public_group) { create(:group, :public) }
let!(:public_milestone) { create(:milestone, group: public_group) } let!(:public_milestone) { create(:milestone, group: public_group) }
let!(:closed_group_milestone) { create(:milestone, group: group, state: 'closed') }
let!(:closed_project_milestone) { create(:milestone, project: project, state: 'closed') }
render_views render_views
...@@ -60,9 +62,6 @@ describe Dashboard::MilestonesController do ...@@ -60,9 +62,6 @@ describe Dashboard::MilestonesController do
end end
it 'returns closed group and project milestones to which the user belongs' do it 'returns closed group and project milestones to which the user belongs' do
closed_group_milestone = create(:milestone, group: group, state: 'closed')
closed_project_milestone = create(:milestone, project: project, state: 'closed')
get :index, params: { state: 'closed' }, format: :json get :index, params: { state: 'closed' }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
...@@ -89,17 +88,7 @@ describe Dashboard::MilestonesController do ...@@ -89,17 +88,7 @@ describe Dashboard::MilestonesController do
expect(response.body).not_to include(project_milestone.title) expect(response.body).not_to include(project_milestone.title)
end end
it 'shows counts of group and project milestones to which the user belongs to' do it 'shows counts of open and closed group and project milestones to which the user belongs to' do
get :index
expect(response.body).to include("Open\n<span class=\"badge badge-pill\">2</span>")
expect(response.body).to include("Closed\n<span class=\"badge badge-pill\">0</span>")
end
it 'shows counts of closed group and project milestones to which the user belongs to' do
closed_group_milestone = create(:milestone, group: group, state: 'closed')
closed_project_milestone = create(:milestone, project: project, state: 'closed')
get :index get :index
expect(response.body).to include("Open\n<span class=\"badge badge-pill\">2</span>") expect(response.body).to include("Open\n<span class=\"badge badge-pill\">2</span>")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment