Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com>2018-10-02 13:00:58 +0300
committerPhil Hughes <me@iamphill.com>2018-10-02 13:00:58 +0300
commitd366ea14380b828daadce14023f0d623b87fe0b3 (patch)
tree07cf7cb229bfc78a3f0522bf127a25f765bae7ee /spec/features/boards
parent7287fd09e264ad5b8efceab4b1919c92769856b9 (diff)
circumvent browser cache on browser back navigation
Diffstat (limited to 'spec/features/boards')
-rw-r--r--spec/features/boards/reload_boards_on_browser_back_spec.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/boards/reload_boards_on_browser_back_spec.rb b/spec/features/boards/reload_boards_on_browser_back_spec.rb
new file mode 100644
index 00000000000..4b4bd705a77
--- /dev/null
+++ b/spec/features/boards/reload_boards_on_browser_back_spec.rb
@@ -0,0 +1,48 @@
+require 'rails_helper'
+
+describe 'Ensure Boards do not show stale data on browser back', :js do
+ 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'
+
+ click_button 'Submit issue'
+
+ 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)
+ expect(page).to have_link(issue.title, href: issue_path(issue))
+ end
+ end
+ end
+end