Sha256: b1f247d991cd5eac26e5472c69ddf491f4141833b04f8d95dab83fe5c3bc708b

Contents?: true

Size: 1.28 KB

Versions: 3

Compression:

Stored size: 1.28 KB

Contents

require 'test_helper'

module Kaui
  class NavigationTest < IntegrationTestHelper

    test 'Browse one account' do
      get BASE_PATH
      assert_redirected_to SIGN_IN_PATH

      # Verify log-in
      post_via_redirect SIGN_IN_PATH, {:user => {:kb_username => USERNAME, :password => PASSWORD}}
      assert_equal BASE_PATH + '/', path
      assert_equal 'Signed in successfully.', flash[:notice]

      # User goes to search for the account
      get ACCOUNTS_PATH
      assert_response :success

      # Assumes he found it on the listing
      get ACCOUNTS_PATH + '/' + @account.account_id
      assert_response :success
      check_no_flash_error
      assert_not_nil assigns(:tags)
      assert_not_nil assigns(:account_emails)
      assert_not_nil assigns(:overdue_state)
      assert_not_nil assigns(:payment_methods)
      assert_not_nil assigns(:bundles)

      # He now clicks on the timeline link
      get ACCOUNT_TIMELINE_PATH + '/' + @account.account_id
      assert_response :success
      check_no_flash_error
      assert_not_nil assigns(:account)
      assert_not_nil assigns(:timeline)

      # Verify log-out
      delete_via_redirect SIGN_OUT_PATH
      assert_equal SIGN_IN_PATH, path
      assert_equal 'You need to sign in or sign up before continuing.', flash[:alert]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaui-0.7.2 test/integration/kaui/navigation_test.rb
kaui-0.7.1 test/integration/kaui/navigation_test.rb
kaui-0.7.0 test/integration/kaui/navigation_test.rb