You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
976 B
41 lines
976 B
3 years ago
|
require "rails_helper"
|
||
|
|
||
|
RSpec.describe CaseLogsController, type: :controller do
|
||
|
let(:valid_session) { {} }
|
||
|
|
||
|
context "Collection routes" do
|
||
|
describe "GET #index" do
|
||
|
it "returns a success response" do
|
||
|
get :index, params: {}, session: valid_session
|
||
|
expect(response).to be_successful
|
||
|
end
|
||
|
end
|
||
|
|
||
|
describe "GET #new" do
|
||
|
it "returns a success response" do
|
||
|
get :new, params: {}, session: valid_session
|
||
|
expect(response).to be_successful
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
context "Instance routes" do
|
||
|
let!(:case_log) { FactoryBot.create(:case_log) }
|
||
|
let(:id) { case_log.id }
|
||
|
|
||
|
describe "GET #show" do
|
||
|
it "returns a success response" do
|
||
|
get :show, params: { id: id }
|
||
|
expect(response).to be_successful
|
||
|
end
|
||
|
end
|
||
|
|
||
|
describe "GET #edit" do
|
||
|
it "returns a success response" do
|
||
|
get :edit, params: { id: id }
|
||
|
expect(response).to be_successful
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|