summaryrefslogtreecommitdiff
path: root/users/test/integration
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-14 14:28:35 +0200
committerAzul <azul@leap.se>2013-07-14 16:11:07 +0200
commit374eb7bd3f369cba946d4b8002cd51a499aef32a (patch)
tree5518005eb69b9767eba5ca3027bbcf555de502a8 /users/test/integration
parentcc32ad53286c2c03c88cb55713565c2930796024 (diff)
js integration test for signup, login, logout
Diffstat (limited to 'users/test/integration')
-rw-r--r--users/test/integration/browser/account_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/users/test/integration/browser/account_test.rb b/users/test/integration/browser/account_test.rb
new file mode 100644
index 0000000..a112430
--- /dev/null
+++ b/users/test/integration/browser/account_test.rb
@@ -0,0 +1,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