diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-21 17:34:00 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-04-28 23:13:48 +0300 |
commit | 0426647069397d57d46c66de41c8fa4fad65e0bb (patch) | |
tree | d91b1c5f48e5481f1fd4ed6034925b4d00bd7ead /spec | |
parent | ed08bfdc26557b4d364dc18299bb21a8be195be6 (diff) |
Load the "New Branch" button asynchronously
This button depends on Issue#can_be_worked_on? which in turn depends on
Issue#related_branches. By rendering this button asynchronously we can
finally remove all usages of Issue#related_branches and
Issue#referenced_merge_requests from the issues "show" page.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues/new_branch_button_spec.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/features/issues/new_branch_button_spec.rb b/spec/features/issues/new_branch_button_spec.rb index 9219b767547..16e188d2a8a 100644 --- a/spec/features/issues/new_branch_button_spec.rb +++ b/spec/features/issues/new_branch_button_spec.rb @@ -11,10 +11,10 @@ feature 'Start new branch from an issue', feature: true do login_as(user) end - it 'shown the new branch button', js: false do + it 'shows the new branch button', js: true do visit namespace_project_issue_path(project.namespace, project, issue) - expect(page).to have_link "New Branch" + expect(page).to have_css('#new-branch .available') end context "when there is a referenced merge request" do @@ -34,16 +34,17 @@ feature 'Start new branch from an issue', feature: true do end it "hides the new branch button", js: true do - expect(page).not_to have_link "New Branch" + expect(page).not_to have_css('#new-branch .available') expect(page).to have_content /1 Related Merge Request/ end end end context "for visiters" do - it 'no button is shown', js: false do + it 'no button is shown', js: true do visit namespace_project_issue_path(project.namespace, project, issue) - expect(page).not_to have_link "New Branch" + + expect(page).not_to have_css('#new-branch') end end end |