Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kookster committed Nov 26, 2024
1 parent 1c01abb commit e2114ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/megaphone/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Megaphone
class Config < ApplicationRecord
belongs_to :feed

validates_presence_of :token, :network_id, :feed_id
validates_presence_of :token, :network_id

encrypts :token
encrypts :network_id
Expand Down
5 changes: 2 additions & 3 deletions test/factories/feed_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@

factory :megaphone_feed, class: "Feeds::MegaphoneFeed" do
type { "Feeds::MegaphoneFeed" }
private { false }
sequence(:slug) { |n| "mp-feed-#{n}" }
private { true }

after(:build) do |feed, _evaluator|
feed.megaphone_config = build(:megaphone_config)
feed.megaphone_config = build(:megaphone_config, feed: feed)
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions test/factories/megaphone_config_factory.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FactoryBot.define do
factory :megaphone_config, class: Megaphone::Config do
publish_enabled { true }
sync_blocks_rss { true }
token { "thisisatokenforacessingtheapi" }
network_id { "this-is-a-network-id" }
network_name { "test network" }
feed
end
end

0 comments on commit e2114ca

Please sign in to comment.