summaryrefslogtreecommitdiff
path: root/users/test/integration/browser/account_test.rb
blob: a1124300cc4c5a29732a79c760c2ba9417b2ed6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class AccountTest < BrowserIntegrationTest

  setup do
    Capybara.current_driver = Capybara.javascript_driver # :selenium by default
  end

  test "normal account workflow" do
    username = "test_#{SecureRandom.urlsafe_base64}".downcase
    password = SecureRandom.base64
    visit '/users/new'
    fill_in 'Username', with: username
    fill_in 'Password', with: password
    fill_in 'Password confirmation', with: password
    click_on 'Sign Up'
    assert page.has_content?("Welcome #{username}"),
      "failed to verify server. expected M2: #{page.evaluate_script("srp.session.getM2();")}"
    click_on 'Logout'
    assert_equal '/', current_path
  end

end