diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index ada4a80d..8d7f1b7d 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -39,13 +39,12 @@ expect(page).to have_text(I18n.t("agreement_letters.upload_success")) end - #scenario "user upload fails" do - #@agreement_letter = FactoryGirl.create(:agreement_letter, user: @user, event: @event) - #@agreement_letter.readonly! - #attach_file(:letter_upload, './spec/testfiles/actual.pdf') - #click_button "upload_btn_#{@event.id}" - #expect(page).to have_text(I18n.t("agreement_letters.upload_failed")) - #end + scenario "user upload fails" do + allow_any_instance_of(AgreementLettersController).to receive(:save_file).and_return(false) + attach_file(:letter_upload, './spec/testfiles/actual.pdf') + click_button "upload_btn_#{@event.id}" + expect(page).to have_text(I18n.t("agreement_letters.upload_failed")) + end end RSpec.feature "Profile adaptation", :type => :feature do