DEV: correct heisentest
This test failed IF this category id number 3 was fabricated to start with at the top of the test. This is very likely if the test is run on a blank DB
This commit is contained in:
parent
09b3d0c2a0
commit
17b34f5744
|
@ -27,22 +27,22 @@ describe Admin::EmbeddableHostsController do
|
|||
|
||||
describe '#update' do
|
||||
it "logs embeddable host update" do
|
||||
|
||||
category = Fabricate(:category)
|
||||
|
||||
put "/admin/embeddable_hosts/#{embeddable_host.id}.json", params: {
|
||||
embeddable_host: { host: "test.com", class_name: "test-class", category_id: "3" }
|
||||
embeddable_host: { host: "test.com", class_name: "test-class", category_id: category.id }
|
||||
}
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
if (!UserHistory.where(
|
||||
history_exists = UserHistory.where(
|
||||
acting_user_id: admin.id,
|
||||
action: UserHistory.actions[:embeddable_host_update],
|
||||
new_value: "host: test.com, class_name: test-class, category_id: 3").exists?)
|
||||
new_value: "host: test.com, class_name: test-class, category_id: #{category.id}").exists?
|
||||
|
||||
expect(history_exists).to eq(true)
|
||||
|
||||
puts "heisentest just failed, debug info is:"
|
||||
puts "count: #{UserHistory.count}"
|
||||
puts "data: #{UserHistory.all.map(&:to_json).join("\n")}"
|
||||
expect("erracit test").to eq("erratic test")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue