Bit of a nitpick but I find myself testing attributes in my feature specs and am beginning to wonder if this is good practice?
For example, I may have a form object which updates multiple models and so I end up with abstracted methods in my capybara spec that look like:
def user_fills_in_form(form_attributes) # fill_in ..., with: ... end def model_attributes_should_equal(args) # expect(something.attribute).to eq args.fetch(:attribute_name) end def another_model_attributes_should_equal(args) # expect(something.attribute).to eq args.fetch(:attribute_name) end
Perhaps I’m doing outside-in TDD wrong - as I think I end up with this situation when I’m trying to test that everything is working correctly from my feature spec before dropping down into the form object unit test.
Is this really an issue - are you strict about this? Is this approach acceptable? Or should you strictly test attribute assignment in your unit tests?