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.23 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.22 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.21 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.20 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.19 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.18 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.17 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.16 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.15 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.14 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.13 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.12 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.11 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.10 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.9 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.8 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.7 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.6 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.5 test/integration/workarea/admin/create_release_undos_integration_test.rb
workarea-admin-3.5.4 test/integration/workarea/admin/create_release_undos_integration_test.rb