milestone_tabs_spec.rb 1.06 KB
Newer Older
1 2
require 'spec_helper'

3
describe 'Dashboard milestone tabs', :js do
4
  let(:user) { create(:user) }
5
  let(:project) { create(:project) }
6 7 8 9 10 11 12 13 14 15 16 17
  let!(:label) { create(:label, project: project) }
  let(:project_milestone) { create(:milestone, project: project) }
  let(:milestone) do
    DashboardMilestone.build(
      [project],
      project_milestone.title
    )
  end
  let!(:merge_request) { create(:labeled_merge_request, source_project: project, target_project: project, milestone: project_milestone, labels: [label]) }

  before do
    project.add_master(user)
18
    sign_in(user)
19 20 21 22 23 24 25

    visit dashboard_milestone_path(milestone.safe_title, title: milestone.title)
  end

  it 'loads merge requests async' do
    click_link 'Merge Requests'

26
    expect(page).to have_selector('.milestone-merge_requests-list')
27 28 29 30 31 32 33 34 35 36 37 38 39 40
  end

  it 'loads participants async' do
    click_link 'Participants'

    expect(page).to have_selector('#tab-participants .bordered-list')
  end

  it 'loads labels async' do
    click_link 'Labels'

    expect(page).to have_selector('#tab-labels .bordered-list')
  end
end