diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-07-14 16:36:37 +0300 |
---|---|---|
committer | Alexander Randa <randa.alex@gmail.com> | 2017-07-17 11:16:41 +0300 |
commit | 1c84f668bc25179848c002d52a4738d379da2a62 (patch) | |
tree | 0d952601e194062345b53bb02a6952cf25138035 /spec/features/projects | |
parent | 7fbcdfb074a0ca92e3d35f6b3c4d78f1940f88ef (diff) |
Replaces dashboard/dashboard.feature spinach with rspec
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/merge_request_button_spec.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/features/projects/merge_request_button_spec.rb b/spec/features/projects/merge_request_button_spec.rb index 12b4747602d..8cbd26551bc 100644 --- a/spec/features/projects/merge_request_button_spec.rb +++ b/spec/features/projects/merge_request_button_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Merge Request button', feature: true do +feature 'Merge Request button' do shared_examples 'Merge request button only shown when allowed' do let(:user) { create(:user) } let(:project) { create(:project, :public) } @@ -10,16 +10,14 @@ feature 'Merge Request button', feature: true do it 'does not show Create merge request button' do visit url - within("#content-body") do - expect(page).not_to have_link(label) - end + expect(page).not_to have_link(label) end end context 'logged in as developer' do before do sign_in(user) - project.team << [user, :developer] + project.add_developer(user) end it 'shows Create merge request button' do @@ -29,7 +27,7 @@ feature 'Merge Request button', feature: true do visit url - within("#content-body") do + within('#content-body') do expect(page).to have_link(label, href: href) end end @@ -42,7 +40,7 @@ feature 'Merge Request button', feature: true do it 'does not show Create merge request button' do visit url - within("#content-body") do + within('#content-body') do expect(page).not_to have_link(label) end end @@ -57,7 +55,7 @@ feature 'Merge Request button', feature: true do it 'does not show Create merge request button' do visit url - within("#content-body") do + within('#content-body') do expect(page).not_to have_link(label) end end |