2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2018-04-11 07:47:23 -04:00
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe "User creates milestone", :js do
|
2020-02-26 13:09:24 -05:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:project) { create(:project) }
|
2018-04-11 07:47:23 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit(new_project_milestone_path(project))
|
|
|
|
end
|
|
|
|
|
|
|
|
it "creates milestone" do
|
2021-03-25 23:09:21 -04:00
|
|
|
title = "v2.3"
|
2018-04-11 07:47:23 -04:00
|
|
|
|
2020-05-05 08:09:31 -04:00
|
|
|
fill_in("Title", with: title)
|
2018-04-11 07:47:23 -04:00
|
|
|
fill_in("Description", with: "# Description header")
|
|
|
|
click_button("Create milestone")
|
|
|
|
|
2020-05-05 08:09:31 -04:00
|
|
|
expect(page).to have_content(title)
|
2018-04-11 07:47:23 -04:00
|
|
|
.and have_content("Issues")
|
|
|
|
.and have_header_with_correct_id_and_link(1, "Description header", "description-header")
|
|
|
|
|
|
|
|
visit(activity_project_path(project))
|
|
|
|
|
2018-11-06 09:33:42 -05:00
|
|
|
expect(page).to have_content("#{user.name} #{user.to_reference} opened milestone")
|
2018-04-11 07:47:23 -04:00
|
|
|
end
|
|
|
|
end
|