Sha256: e45587ef9c2b20e2f139fa5775d17f5ceff6e906e7ce134521603f60472437dd

Contents?: true

Size: 1.24 KB

Versions: 69

Compression:

Stored size: 1.24 KB

Contents

require 'test_helper'

class DiscoApp::InstallControllerTest < ActionController::TestCase
  include ActiveJob::TestHelper

  def setup
    @shop = disco_app_shops(:widget_store)
    @routes = DiscoApp::Engine.routes
    log_in_as(@shop)
  end

  def teardown
    @shop = nil
  end

  test 'logged-in but uninstalled user triggers installation from install page' do
    get(:install)
    assert_redirected_to :installing
    assert_enqueued_jobs 1
    @shop.reload
    assert @shop.awaiting_install?
  end

  test 'logged-in and installed user is redirected to installing url for install/uninstalling actions' do
    @shop.installed!
    [:install, :uninstalling].each do |action|
      get(:install)
      assert_redirected_to :installing
    end
  end

  test 'logged-in and installed user is redirected to root url for installing' do
    @shop.installed!
    get(:installing)
    assert_redirected_to Rails.application.routes.url_helpers.root_path
  end

  test 'logged-in and uninstalling user sees uninstalling page' do
    @shop.uninstalling!
    get(:uninstalling)
    assert_response :success
  end

  test 'logged-in and uninstalled user starts install process again' do
    @shop.uninstalled!
    get(:uninstalling)
    assert_redirected_to :install
  end

end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
disco_app-0.15.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.16.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.14.4 test/controllers/disco_app/install_controller_test.rb
disco_app-0.14.3 test/controllers/disco_app/install_controller_test.rb
disco_app-0.16.1 test/controllers/disco_app/install_controller_test.rb
disco_app-0.15.2 test/controllers/disco_app/install_controller_test.rb
disco_app-0.12.7.pre.puma.pre.3 test/controllers/disco_app/install_controller_test.rb
disco_app-0.14.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.13.6.pre.puma.pre.3 test/controllers/disco_app/install_controller_test.rb