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