diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-24 21:50:08 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-24 21:50:08 +0300 |
commit | b9156669fef4fd96862a5caf720e4820c43325ab (patch) | |
tree | f064f7cdf54abb1ccff5ded2236ad9ce210cda0f /features/steps/profile | |
parent | 93e6282657b3c8498a9e705c6b4dc153ce6cade5 (diff) |
Fix Profile Avatar feature steps
Diffstat (limited to 'features/steps/profile')
-rw-r--r-- | features/steps/profile/profile.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 6b0c1049ece..7895f643d0c 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -27,9 +27,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I change my avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) - click_button "Save changes" - @user.reload + attach_avatar end step 'I should see new avatar' do @@ -42,9 +40,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I have an avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) - click_button "Save changes" - @user.reload + attach_avatar end step 'I remove my avatar' do @@ -233,4 +229,16 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step "I see that application is removed" do expect(page.find(".oauth-applications")).not_to have_content "test_changed" end + + def attach_avatar + attach_file :user_avatar, Rails.root.join(*%w(spec fixtures banana_sample.gif)) + + page.find('#user_avatar_crop_x', visible: false).set('0') + page.find('#user_avatar_crop_y', visible: false).set('0') + page.find('#user_avatar_crop_size', visible: false).set('256') + + click_button "Save changes" + + @user.reload + end end |