Files
openfoodnetwork/spec/models/connected_app_spec.rb
Maikel Linke dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00

20 lines
601 B
Ruby

# frozen_string_literal: true
RSpec.describe ConnectedApp do
it { is_expected.to belong_to :enterprise }
it "stores data as json hash" do
# This functionality is just Rails and would usually not warrant a spec but
# it's the first time we use the json datatype in this codebase and
# therefore it's a nice example to see how it works.
expect(subject.data).to eq nil
subject.enterprise = create(:enterprise)
subject.data = { link: "https://example.net" }
subject.save!
subject.reload
expect(subject.data).to eq({ "link" => "https://example.net" })
end
end