Fix board relates specs

parent 2ad531f5
...@@ -32,6 +32,6 @@ class Projects::BoardsController < Projects::ApplicationController ...@@ -32,6 +32,6 @@ class Projects::BoardsController < Projects::ApplicationController
end end
def serialize_as_json(resource) def serialize_as_json(resource)
resource.as_json(only: [:id, :name]) resource.as_json(only: [:id])
end end
end end
...@@ -18,7 +18,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -18,7 +18,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'no lists' do context 'no lists' do
before do before do
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
...@@ -61,8 +61,8 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -61,8 +61,8 @@ describe 'Issue Boards', feature: true, js: true do
let!(:done) { create(:label, project: project, name: 'Done') } let!(:done) { create(:label, project: project, name: 'Done') }
let!(:accepting) { create(:label, project: project, name: 'Accepting Merge Requests') } let!(:accepting) { create(:label, project: project, name: 'Accepting Merge Requests') }
let!(:list1) { create(:list, board: project.board, label: planning, position: 0) } let!(:list1) { create(:list, board: board, label: planning, position: 0) }
let!(:list2) { create(:list, board: project.board, label: development, position: 1) } let!(:list2) { create(:list, board: board, label: development, position: 1) }
let!(:confidential_issue) { create(:issue, :confidential, project: project, author: user) } let!(:confidential_issue) { create(:issue, :confidential, project: project, author: user) }
let!(:issue1) { create(:issue, project: project, assignee: user) } let!(:issue1) { create(:issue, project: project, assignee: user) }
...@@ -76,7 +76,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -76,7 +76,7 @@ describe 'Issue Boards', feature: true, js: true do
let!(:issue9) { create(:labeled_issue, project: project, labels: [testing, bug, accepting]) } let!(:issue9) { create(:labeled_issue, project: project, labels: [testing, bug, accepting]) }
before do before do
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
...@@ -170,7 +170,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -170,7 +170,7 @@ describe 'Issue Boards', feature: true, js: true do
create(:issue, project: project) create(:issue, project: project)
end end
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
page.within(find('.board', match: :first)) do page.within(find('.board', match: :first)) do
...@@ -604,7 +604,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -604,7 +604,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'keyboard shortcuts' do context 'keyboard shortcuts' do
before do before do
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
end end
...@@ -617,7 +617,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -617,7 +617,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do context 'signed out user' do
before do before do
logout logout
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
end end
...@@ -633,7 +633,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -633,7 +633,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user_guest, :guest] project.team << [user_guest, :guest]
logout logout
login_as(user_guest) login_as(user_guest)
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
end end
......
...@@ -6,9 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do ...@@ -6,9 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
before do before do
project.create_board create(:board, project: project)
project.board.lists.create(list_type: :backlog)
project.board.lists.create(list_type: :done)
login_as :admin login_as :admin
......
...@@ -14,7 +14,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -14,7 +14,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
...@@ -70,7 +70,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -70,7 +70,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
context 'unauthorized user' do context 'unauthorized user' do
before do before do
visit namespace_project_board_path(project.namespace, project) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_vue_resource
end end
......
{ {
"type": "object", "type": "object",
"required" : [ "required" : [
"id", "id"
"name"
], ],
"properties" : { "properties" : {
"id": { "type": "integer" }, "id": { "type": "integer" },
......
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