In Rails I have a field that is supposed to save json data. It's of type json. My current Rspec is as follows:
it 'My field has some json data saved' do person = People.last saved_national_id_data = JSON.parse(person.raw_national_id_data) # check some attributes have proper data end Now here I'm assuming that the field is json. Is there a way in Rspec to check that the returned data for this field is of type json? Example:
expect(saved_national_id_data).to be_json