Sha256: dec29deb11f78909bc4cc18a38297ccc5d81999224106454952b7f0975f1ab49

Contents?: true

Size: 624 Bytes

Versions: 11

Compression:

Stored size: 624 Bytes

Contents

require 'spec_helper'

describe LoldesignPublisher::ActivablesController, type: :controller do
  describe '#create' do
    let!(:user){ create(:user) }

    before{ post(:create, resource_name: 'User', id: user.id) }

    it{expect(user.reload.active).to be true}  
    it{expect(response.body).to eq("{\"message\":\"User - 1 activated.\"}")}
  end

  describe '#destroy' do
    let!(:user){ create(:user, :actived) }

    before{ delete(:destroy, resource_name: 'User', id: user.id) }

    it{expect(user.reload.active).to be false}  
    it{expect(response.body).to eq("{\"message\":\"User - 1 inactivated.\"}")}
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
loldesign_publisher-2.0.0 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.5.1 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.5.0 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.4.0 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.6 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.4 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.3 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.2 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.1 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.3.0 spec/controllers/loldesign_publisher/activables_controller_spec.rb
loldesign_publisher-1.1.0 spec/controllers/loldesign_publisher/activables_controller_spec.rb