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.16.1.pre.sidekiq.pre.6.pre.release test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.1 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.2 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.3 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.4 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.5 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.6 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.7 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.8 test/controllers/disco_app/install_controller_test.rb
disco_app-0.6.9 test/controllers/disco_app/install_controller_test.rb
disco_app-0.7.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.7.1 test/controllers/disco_app/install_controller_test.rb
disco_app-0.7.2 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.0 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.1 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.2 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.3 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.4 test/controllers/disco_app/install_controller_test.rb
disco_app-0.8.5 test/controllers/disco_app/install_controller_test.rb