Sha256: 87b6921ebccdb21d11a6908c36446d162afca460bd9d261c05faf8f86cc24854

Contents?: true

Size: 953 Bytes

Versions: 25

Compression:

Stored size: 953 Bytes

Contents

require 'test_helper'

module Workarea
  module Admin
    class CreateReleaseUndosIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_create
        releasable = create_page(name: 'Foo')
        release = create_release

        release.as_current { releasable.update_attributes!(name: 'Bar') }

        post admin.release_undo_path(release),
          params: { release: { name: 'Undo Bar', tag_list: 'foo,bar,baz' } }

        assert_equal(2, Release.count)
        undo_release = Release.desc(:created_at).first

        assert_equal(undo_release, release.reload.undo)
        assert_equal('Undo Bar', undo_release.name)
        assert_equal(%w(foo bar baz), undo_release.tags)
        assert_equal(1, undo_release.changesets.size)
        assert_equal(1, undo_release.changesets.first.changeset.size)
        assert_equal(releasable, undo_release.changesets.first.releasable)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
workarea-admin-3.5.3 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.2 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.1 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.0 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.0.beta.1 test/integration/workarea/admin/create_release_undos_integration_test.rb