spec: Add spec for communication channel confirmation

Change-Id: I1cf9c5731635eed04e39f0f56750902cee45f2a4
Reviewed-on: https://gerrit.instructure.com/80893
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
This commit is contained in:
Deepeeca Soundarrajan 2016-05-27 13:10:42 -06:00
parent fce0ed7d0a
commit bd238b5de5
1 changed files with 24 additions and 4 deletions

View File

@ -37,7 +37,7 @@ describe "communication channel selenium tests" do
u1.accept_terms
u1.save
# d'oh, now it's taken
u2 = user_with_pseudonym(:username => 'asdf@qwerty.com', :active_user => true)
user_with_pseudonym(:username => 'asdf@qwerty.com', :active_user => true)
get "/register/#{u1.communication_channel.confirmation_code}"
# they can set it...
@ -52,9 +52,29 @@ describe "communication channel selenium tests" do
expect_logout_link_present
end
it 'confirms the communication channels', priority: "2", test_id: 193786 do
user_with_pseudonym({active_user: true})
create_session(@pseudonym)
get '/profile/settings'
expect(f('.email_channels')).to contain_css('.unconfirmed')
f('.email_channels .path').click
Notification.create!(name: 'Confirm Email Communication Channel', category: 'Registration')
f('#confirm_email_channel .re_send_confirmation_link').click
expect(Message.last.subject).to eq('Confirm Email: Canvas')
url = Message.last.url
# get the registration id from the url
get '/register/' + url.split('/')[4]
expect(f('#flash_message_holder')).to include_text 'Registration confirmed!'
get '/profile/settings'
# the email id does not have a link anymore
expect(f('.email_channels')).not_to contain_link('nobody@example.com')
end
it 'should show the bounce count reset button when a siteadmin is masquerading' do
u = user_with_pseudonym(active_all: true)
cc = u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active'; cc.bounce_count = 3 }
u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active'; cc.bounce_count = 3 }
site_admin_logged_in
masquerade_as(u)
@ -65,7 +85,7 @@ describe "communication channel selenium tests" do
it 'should not show the bounce count reset button when an account admin is masquerading' do
u = user_with_pseudonym(active_all: true)
cc = u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active'; cc.bounce_count = 3 }
u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active'; cc.bounce_count = 3 }
admin_logged_in
masquerade_as(u)
@ -76,7 +96,7 @@ describe "communication channel selenium tests" do
it 'should not show the bounce count reset button when the channel is not bouncing' do
u = user_with_pseudonym(active_all: true)
cc = u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active' }
u.communication_channels.create!(:path => 'test@example.com', :path_type => 'email') { |cc| cc.workflow_state = 'active' }
site_admin_logged_in
masquerade_as(u)