2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 07:56:52 +00:00
|
|
|
require 'spec_helper'
|
2018-10-02 10:00:58 +00:00
|
|
|
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'Ensure Boards do not show stale data on browser back', :js do
|
2018-10-02 10:00:58 +00:00
|
|
|
let(:project) {create(:project, :public)}
|
|
|
|
let(:board) {create(:board, project: project)}
|
|
|
|
let(:user) {create(:user)}
|
|
|
|
|
|
|
|
context 'authorized user' do
|
|
|
|
before do
|
|
|
|
project.add_maintainer(user)
|
|
|
|
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit project_board_path(project, board)
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.within(first('.board .issue-count-badge-count')) do
|
|
|
|
expect(page).to have_content('0')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'created issue is listed on board' do
|
|
|
|
visit new_project_issue_path(project)
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
fill_in 'issue_title', with: 'issue should be shown'
|
|
|
|
|
2021-03-30 06:09:35 +00:00
|
|
|
click_button 'Create issue'
|
2018-10-02 10:00:58 +00:00
|
|
|
|
|
|
|
page.go_back
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.go_back
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.within(first('.board .issue-count-badge-count')) do
|
|
|
|
expect(page).to have_content('1')
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board-card')) do
|
|
|
|
issue = project.issues.find_by_title('issue should be shown')
|
|
|
|
|
|
|
|
expect(page).to have_content(issue.to_reference)
|
2021-03-26 09:09:24 +00:00
|
|
|
expect(page).to have_link(issue.title, href: /#{issue_path(issue)}/)
|
2018-10-02 10:00:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|