Sha256: d6476a5022261428c6924374403fc4a2c60a313d9caae295c55d10d4cb6cf09d

Contents?: true

Size: 570 Bytes

Versions: 11

Compression:

Stored size: 570 Bytes

Contents

require 'test_helper'
require 'cancancan'

class RailsOps::Mixins::ControllerTest < ActionDispatch::IntegrationTest
  include TestHelper

  def test_controller_op
    group = Group.create(name: 'group')
    get group_url(group), as: :json
    assert_equal 'group', JSON.parse(@response.body)['name']
  end

  def test_controller_op_run
    group = Group.create(name: 'group')
    patch group_url(group), params: { name: 'group2' }, as: :json
    assert_equal 'group2', JSON.parse(@response.body)['name']

    group.reload
    assert_equal 'group2', group.name
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_ops-1.5.8 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.5.7 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.5.6 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.5.5 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.5.4 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.5.0 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.4.8 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.4.7 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.4.6 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.4.5 test/unit/rails_ops/mixins/controller_test.rb
rails_ops-1.4.4 test/unit/rails_ops/mixins/controller_test.rb