require 'integration_test_helper' class GovukGuix::RevisionsControllerTest < ActionDispatch::IntegrationTest setup do login_as User.new(name: 'Test', email: 'test@example.com') end test 'show' do revision = GovukGuix::Revision.create!( commit_hash: 'test-commit-hash', store_path: 'test-store-path' ) get govuk_guix_revision_path(revision) assert_response :success end test 'enqueue_fetch_revision' do revision = 'test-revision' Guix.stubs(:available_locally?).returns(true) GovukGuix::FetchRevisionJob.expects(:enqueue).with(revision, {}) post( enqueue_fetch_govuk_guix_revision_path, params: { revision: revision } ) assert_response :redirect follow_redirect! assert_response :success end end