Submit social housing lettings and sales data (CORE)
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.

30 lines
832 B

require "rails_helper"
require_relative "../../support/devise"
describe Admin::CaseLogsController, type: :controller do
render_views
let(:page) { Capybara::Node::Simple.new(response.body) }
let(:resource_title) { "Case Logs" }
let(:valid_session) { {} }
login_admin_user
describe "Get case logs" do
let!(:case_log) { FactoryBot.create(:case_log, :in_progress) }
before do
get :index, session: valid_session
end
it "returns a table of case logs" do
expect(page).to have_content(resource_title)
expect(page).to have_table("index_table_case_logs")
expect(page).to have_link(case_log.id.to_s)
end
end
describe "Create case logs" do
it "creates a new case log" do
expect { post :create, session: valid_session }.to change(CaseLog, :count).by(1)
end
end
end