Created
March 25, 2020 19:58
-
-
Save arubis/e26dc1ba6e2df602384961708f224ce4 to your computer and use it in GitHub Desktop.
Asking for a friend!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryBot.define do | |
factory :car_communication_rule do | |
rule_id { SecureRandom.uuid } | |
end | |
trait :tire_pressure do | |
transient do | |
tp_code { "FR" } | |
tp_name { "Front right" } | |
end | |
category { :tire_pressure } | |
demo_data do | |
MyApiCall.send(:method_name, | |
"TIREPRESSURE#{tp_code}", | |
"#{tp_name} tire pressure is low") | |
end | |
end | |
trait :tire_pressure_front_left do | |
transient do | |
tp_code { "FL" } | |
tp_name { "Front left" } | |
end | |
tire_pressure | |
end | |
# then similar for :tire_pressure_front_right, _rear_left, _rear_right | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment