I want to test my strong parameters in rails controllers. The best way I have found so far is the one described here: http://pivotallabs.com/rails-4-testing-strong-parameters/
Unfortunately this leads to "blacklist" testing: I can only test wether certain parameters are discarded. What I would like to do is "whitelist" testing: making sure that only certain parameters are permitted.
My idea was to figure out all attributes of the model, set them all to some value, and pass them to the class. Then I could test if only whitelisted parameters come through.
Unfortunately I haven't found a way to set all attributes without knowing them. Any help?
Thanks!