email_spec.rb 634 B

12345678910111213141516171819202122
  1. require 'rails_helper'
  2. RSpec.describe 'Manage > Channels > Email', type: :system do
  3. context 'non editable' do
  4. it 'hides "Edit" links' do
  5. # ensure that the only existing email channel
  6. # has preferences == { editable: false }
  7. Channel.destroy_all
  8. create(:email_channel, preferences: { editable: false })
  9. visit '/#channels/email'
  10. # verify page has loaded
  11. expect(page).to have_css('#c-account h3', text: 'Inbound')
  12. expect(page).to have_css('#c-account h3', text: 'Outbound')
  13. expect(page).not_to have_css('.js-editInbound, .js-editOutbound', text: 'Edit')
  14. end
  15. end
  16. end