summaryrefslogtreecommitdiff
path: root/test/integration/browser/alternate_email_test.rb
blob: fc58fb4edb3c2f6306a628c6b2f9de03b8513c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'test_helper'

class AlternateEmailTest < BrowserIntegrationTest
  test "change alternate email" do
    username, password = submit_signup
    click_on 'Account Settings'
    within(".edit_user") do
      fill_in 'user_contact_email', with: 'test@leap.se'
      click_on 'Save'
    end
    assert page.has_content?('Changes saved successfully')
    assert_equal 'test@leap.se',
      page.find('#user_contact_email').value
  end

  test "change alternate email to invalid" do
    username, password = submit_signup
    click_on 'Account Settings'
    within(".edit_user") do
      fill_in 'user_contact_email', with: 'test@invalid'
      click_on 'Save'
      assert page.has_content?('is invalid')
    end
  end
end