Sha256: db97e8ca7c25dd66f103f6cae1893b25f9c20e9475b01a925a23f9637d4a6770

Contents?: true

Size: 1.67 KB

Versions: 21

Compression:

Stored size: 1.67 KB

Contents

require 'test_helper'

class HomeControllerTest < ActionController::TestCase

  def setup
    @shop = disco_app_shops(:widget_store)
    log_in_as(@shop)
  end

  def teardown
    @shop = nil
  end

  test 'non-logged in user is redirected to the login page' do
    log_out
    get(:index)
    assert_redirected_to ShopifyApp::Engine.routes.url_helpers.login_path
  end

  test 'logged-in, never installed user is redirected to the install page' do
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.install_path
  end

  test 'logged-in, awaiting install user is redirected to the installing page' do
    @shop.awaiting_install!
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.installing_path
  end

  test 'logged-in, installing user is redirected to the installing page' do
    @shop.installing!
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.installing_path
  end

  test 'logged-in, installed user is able to access the page' do
    @shop.installed!
    get(:index)
    assert_response :success
  end

  test 'logged-in, awaiting uninstall user is redirected to the uninstalling page' do
    @shop.awaiting_uninstall!
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.uninstalling_path
  end

  test 'logged-in, uninstalling user is redirected to the uninstalling page' do
    @shop.uninstalling!
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.uninstalling_path
  end

  test 'logged-in, uninstalled user is redirected to the install page' do
    @shop.uninstalled!
    get(:index)
    assert_redirected_to DiscoApp::Engine.routes.url_helpers.install_path
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
disco_app-0.6.0 test/controllers/home_controller_test.rb
disco_app-0.6.1 test/controllers/home_controller_test.rb
disco_app-0.6.2 test/controllers/home_controller_test.rb
disco_app-0.6.3 test/controllers/home_controller_test.rb
disco_app-0.6.4 test/controllers/home_controller_test.rb
disco_app-0.6.5 test/controllers/home_controller_test.rb
disco_app-0.6.6 test/controllers/home_controller_test.rb
disco_app-0.6.7 test/controllers/home_controller_test.rb
disco_app-0.6.8 test/controllers/home_controller_test.rb
disco_app-0.6.9 test/controllers/home_controller_test.rb
disco_app-0.7.0 test/controllers/home_controller_test.rb
disco_app-0.7.1 test/controllers/home_controller_test.rb
disco_app-0.7.2 test/controllers/home_controller_test.rb
disco_app-0.8.0 test/controllers/home_controller_test.rb
disco_app-0.8.1 test/controllers/home_controller_test.rb
disco_app-0.8.2 test/controllers/home_controller_test.rb
disco_app-0.8.3 test/controllers/home_controller_test.rb
disco_app-0.8.4 test/controllers/home_controller_test.rb
disco_app-0.8.5 test/controllers/home_controller_test.rb
disco_app-0.8.6 test/controllers/home_controller_test.rb