Commit 3460dd0a authored by Phil Hughes's avatar Phil Hughes Committed by Douglas Barbosa Alexandre

Fixed some tests

Updated generate URL
parent 098d461c
......@@ -61,7 +61,7 @@
}
if (this.open && !this.boards.length) {
this.$http.get(this.endpoint).then((resp) => {
gl.boardService.allBoards().then((resp) => {
this.loading = false;
this.boards = resp.json();
});
......
......@@ -2,8 +2,7 @@ class BoardService {
constructor (root, boardId) {
Vue.http.options.root = root;
this.boards = Vue.resource(`${root}{/id}`);
this.boards = Vue.resource(`${root}{/id}.json`);
this.lists = Vue.resource(`${root}/${boardId}/lists{/id}`, {}, {
generate: {
method: 'POST',
......@@ -19,6 +18,10 @@ class BoardService {
});
}
allBoards () {
return this.boards.get();
}
createBoard (board) {
if (board.id) {
return this.boards.update({ id: board.id }, board);
......
%boards-selector{ "inline-template" => true,
endpoint: namespace_project_boards_path(@project.namespace, @project, :json),
":current-board" => "#{board.to_json}" }
.boards-title-holder.dropdown
%button.boards-switcher{ "@click" => "loadBoards",
......
......@@ -5,7 +5,7 @@ describe 'Issue Boards', feature: true, js: true do
include WaitForVueResource
let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) }
let!(:board) { create(:board, project: project) }
let(:user) { create(:user) }
let!(:user2) { create(:user) }
......@@ -18,7 +18,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'no lists' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
expect(page).to have_selector('.board', count: 3)
end
......@@ -76,7 +76,7 @@ describe 'Issue Boards', feature: true, js: true do
let!(:issue9) { create(:labeled_issue, project: project, labels: [testing, bug, accepting]) }
before do
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
......@@ -170,7 +170,7 @@ describe 'Issue Boards', feature: true, js: true do
create(:issue, project: project)
end
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
page.within(find('.board', match: :first)) do
......@@ -604,7 +604,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'keyboard shortcuts' do
before do
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
end
......@@ -617,7 +617,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
logout
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
end
......@@ -633,7 +633,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user_guest, :guest]
logout
login_as(user_guest)
visit namespace_project_board_path(project.namespace, project, board)
visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource
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