|
|
|
@ -210,19 +210,19 @@ RSpec.describe CaseLog do
|
|
|
|
|
hbrentshortfall: 1, |
|
|
|
|
}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "production specific code" do |
|
|
|
|
|
|
|
|
|
context "when a case log is created in production" do |
|
|
|
|
before do |
|
|
|
|
allow(Rails.env).to receive(:production?).and_return(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "derives that all forms are general needs when in production" do |
|
|
|
|
it "derives that all forms are general needs" do |
|
|
|
|
case_log = FactoryBot.create(:case_log) |
|
|
|
|
record_from_db = ActiveRecord::Base.connection.execute("select needstype from case_logs where id=#{case_log.id}").to_a[0] |
|
|
|
|
expect(record_from_db["needstype"]).to eq(1) |
|
|
|
|
expect(case_log["needstype"]).to eq(1) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "correctly derives and saves partial and full major repairs date" do |
|
|
|
|
record_from_db = ActiveRecord::Base.connection.execute("select mrcdate from case_logs where id=#{case_log.id}").to_a[0] |
|
|
|
@ -2119,7 +2119,7 @@ RSpec.describe CaseLog do
|
|
|
|
|
it "returns true for a case log" do |
|
|
|
|
case_log = FactoryBot.create(:case_log) |
|
|
|
|
expect(case_log.needs_question_enabled?).to eq(true) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|