baarkerlounger
3 years ago
5 changed files with 48 additions and 15 deletions
@ -0,0 +1,41 @@
|
||||
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 } |
||||
puts response |
||||
expect(response).to be_successful |
||||
end |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue