Stabilize social_relay_presenter_spec.rb
This commit is contained in:
parent
dc0258f8a6
commit
48e5db8235
2 changed files with 10 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class SocialRelayPresenter
|
||||
def as_json(*)
|
||||
{
|
||||
"subscribe" => AppConfig.relay.inbound.subscribe,
|
||||
"subscribe" => AppConfig.relay.inbound.subscribe?,
|
||||
"scope" => AppConfig.relay.inbound.scope,
|
||||
"tags" => tags
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ describe SocialRelayPresenter do
|
|||
end
|
||||
|
||||
it "provides pod tags" do
|
||||
expect(@presenter.as_json).to eq(
|
||||
expect(@presenter.as_json).to match(
|
||||
"subscribe" => false,
|
||||
"scope" => "tags",
|
||||
"tags" => ["foo", "bar"]
|
||||
"tags" => a_collection_containing_exactly("foo", "bar")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -46,15 +46,15 @@ describe SocialRelayPresenter do
|
|||
lootag = FactoryGirl.create(:tag, name: "loo")
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: ceetag)
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: lootag)
|
||||
alice.last_seen = Time.now - 2.month
|
||||
alice.last_seen = Time.zone.now - 2.months
|
||||
alice.save
|
||||
end
|
||||
|
||||
it "provides user tags" do
|
||||
expect(@presenter.as_json).to eq(
|
||||
expect(@presenter.as_json).to match(
|
||||
"subscribe" => false,
|
||||
"scope" => "tags",
|
||||
"tags" => ["cee", "loo"]
|
||||
"tags" => a_collection_containing_exactly("cee", "loo")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -67,15 +67,15 @@ describe SocialRelayPresenter do
|
|||
lootag = FactoryGirl.create(:tag, name: "loo")
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: ceetag)
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: lootag)
|
||||
alice.last_seen = Time.now - 2.month
|
||||
alice.last_seen = Time.zone.now - 2.months
|
||||
alice.save
|
||||
end
|
||||
|
||||
it "provides combined pod and user tags" do
|
||||
expect(@presenter.as_json).to eq(
|
||||
expect(@presenter.as_json).to match(
|
||||
"subscribe" => false,
|
||||
"scope" => "tags",
|
||||
"tags" => ["foo", "bar", "cee", "loo"]
|
||||
"tags" => a_collection_containing_exactly("foo", "bar", "cee", "loo")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -88,7 +88,7 @@ describe SocialRelayPresenter do
|
|||
lootag = FactoryGirl.create(:tag, name: "loo")
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: ceetag)
|
||||
FactoryGirl.create(:tag_following, user: alice, tag: lootag)
|
||||
alice.last_seen = Time.now - 8.month
|
||||
alice.last_seen = Time.zone.now - 8.months
|
||||
alice.save
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue