Skip to content

Commit

Permalink
for #1350 - fix test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKo committed Apr 2, 2015
1 parent e741677 commit fa2460a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/features/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
click_button 'sign_up'
end
end
end

feature 'User sign in' do
scenario "banned user wants to sing in" do
user = FactoryGirl.create :user, banned: true
FactoryGirl.create :content, key:'banned', body: '<p>You are banned.</p>'
Expand All @@ -73,6 +75,20 @@
page.must_have_content 'You are banned.'
page.wont_have_content I18n.t 'devise.sessions.signed_in'
end

scenario 'Legal entity who needs to reaccept direct debit signs in' do
user = FactoryGirl.create :legal_entity, direct_debit: false
FactoryGirl.create :article, seller: user
visit new_user_session_path

fill_in 'user_email', with: user.email
fill_in 'user_password', with: 'password'
click_button I18n.t('formtastic.actions.login')

page.must_have_content I18n.t 'devise.sessions.signed_in'
page.must_have_content I18n.t 'users.notices.sepa_missing'
current_path.must_equal '/user/edit'
end
end

feature "User account management" do
Expand Down

0 comments on commit fa2460a

Please sign in to comment.