docbrown/spec/models/podcast_ownership_spec.rb
Mac Siri 842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00

14 lines
437 B
Ruby

require "rails_helper"
RSpec.describe PodcastOwnership do
let(:podcast_ownership) { create(:podcast_ownership) }
describe "validations" do
subject { podcast_ownership }
it { is_expected.to belong_to(:owner).class_name("User").with_foreign_key(:user_id).inverse_of(:podcasts_owned) }
it { is_expected.to belong_to(:podcast) }
it { is_expected.to validate_uniqueness_of(:podcast_id).scoped_to(:user_id) }
end
end