Sha256: bb9419538d9b33169361414098b9c5a991e7cd7423f6b88d3b29803647e1df32

Contents?: true

Size: 763 Bytes

Versions: 22

Compression:

Stored size: 763 Bytes

Contents

require 'rails_helper'

describe Kuroko2::StarsController do
  routes { Kuroko2::Engine.routes }

  before { sign_in }

  describe '#create' do
    subject! { post :create,  params: { job_definition_id: definition.id }, xhr: true }
    let(:definition) { create :job_definition }

    it do
      expect(response).to have_http_status(:created)
    end
  end

  describe '#destroy' do
    subject! { delete :destroy,  params: { job_definition_id: definition.id, id: star.id }, xhr: true }
    let(:star) { create :star, user: controller.current_user, job_definition: definition }
    let(:definition) { create :job_definition }

    it do
      expect(response).to have_http_status(:ok)
      expect(Kuroko2::Star.exists?(star.id)).to be_falsey
    end
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
kuroko2-0.8.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.7.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.6.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.5.2 spec/controllers/stars_controller_spec.rb
kuroko2-0.5.1 spec/controllers/stars_controller_spec.rb
kuroko2-0.5.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.6 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.5 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.4 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.3 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.2 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.1 spec/controllers/stars_controller_spec.rb
kuroko2-0.4.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.3.4 spec/controllers/stars_controller_spec.rb
kuroko2-0.3.3 spec/controllers/stars_controller_spec.rb
kuroko2-0.3.2 spec/controllers/stars_controller_spec.rb
kuroko2-0.3.1 spec/controllers/stars_controller_spec.rb
kuroko2-0.3.0 spec/controllers/stars_controller_spec.rb
kuroko2-0.2.3 spec/controllers/stars_controller_spec.rb
kuroko2-0.2.2 spec/controllers/stars_controller_spec.rb