Commit e3e8bb8f authored by Luke Duncalfe's avatar Luke Duncalfe

Move Design Management request specs to FOSS

Now that the views have been moved to FOSS for Design Management in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31309 we can move
the request specs.

This change is part of
https://gitlab.com/gitlab-org/gitlab/-/issues/212566 to move all Design
Management code to FOSS.
parent f78a5129
...@@ -4,44 +4,7 @@ require 'spec_helper' ...@@ -4,44 +4,7 @@ require 'spec_helper'
describe 'Dashboard todos' do describe 'Dashboard todos' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:author) { create(:user) }
let_it_be(:project) { create(:project, :public) }
let_it_be(:issue) { create(:issue, project: project) }
let(:page_path) { dashboard_todos_path } let(:page_path) { dashboard_todos_path }
it_behaves_like 'dashboard gold trial callout' it_behaves_like 'dashboard gold trial callout'
context 'User has a todo regarding a design' do
let_it_be(:target) { create(:design, issue: issue) }
let_it_be(:note) { create(:note, project: project, note: "I am note, hear me roar") }
let_it_be(:todo) do
create(:todo, :mentioned,
user: user,
project: project,
target: target,
author: author,
note: note)
end
before do
sign_in(user)
project.add_developer(user)
visit page_path
end
it 'has todo present' do
expect(page).to have_selector('.todos-list .todo', count: 1)
end
it 'has a link that will take me to the design page' do
click_link "design #{target.to_reference}"
expectation = Gitlab::Routing.url_helpers.designs_project_issue_path(
target.project, target.issue, target.filename
)
expect(current_path).to eq(expectation)
end
end
end end
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
require 'spec_helper' require 'spec_helper'
describe 'Dashboard Todos' do describe 'Dashboard Todos' do
let(:user) { create(:user, username: 'john') } let_it_be(:user) { create(:user, username: 'john') }
let(:author) { create(:user) } let_it_be(:author) { create(:user) }
let(:project) { create(:project, :public) } let_it_be(:project) { create(:project, :public) }
let(:issue) { create(:issue, due_date: Date.today, title: "Fix bug") } let_it_be(:issue) { create(:issue, due_date: Date.today, title: "Fix bug") }
context 'User does not have todos' do context 'User does not have todos' do
before do before do
...@@ -357,4 +357,38 @@ describe 'Dashboard Todos' do ...@@ -357,4 +357,38 @@ describe 'Dashboard Todos' do
expect(page).to have_link "merge request #{todo.target.to_reference}", href: href expect(page).to have_link "merge request #{todo.target.to_reference}", href: href
end end
end end
context 'User has a todo regarding a design' do
let_it_be(:target) { create(:design, issue: issue, project: project) }
let_it_be(:note) { create(:note, project: project, note: 'I am note, hear me roar') }
let_it_be(:todo) do
create(:todo, :mentioned,
user: user,
project: project,
target: target,
author: author,
note: note)
end
before do
project.add_developer(user)
sign_in(user)
visit dashboard_todos_path
end
it 'has todo present' do
expect(page).to have_selector('.todos-list .todo', count: 1)
end
it 'has a link that will take me to the design page' do
click_link "design #{target.to_reference}"
expectation = Gitlab::Routing.url_helpers.designs_project_issue_path(
target.project, target.issue, target.filename
)
expect(current_path).to eq(expectation)
end
end
end end
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