about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-20 02:43:20 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-20 02:43:20 +0200
commit608a2bfffc9186e71d52e0916b54b0f513994db2 (patch)
tree3a2d900162a1fc62a0221c180404771d5c787bcc /spec
parenta86f21cf90814ef0dd6e013202fb93ee83beca86 (diff)
Upgrade to PubSubHubbub 0.4 (removing verify_token)
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/api/subscriptions_controller_spec.rb4
-rw-r--r--spec/models/account_spec.rb8
2 files changed, 5 insertions, 7 deletions
diff --git a/spec/controllers/api/subscriptions_controller_spec.rb b/spec/controllers/api/subscriptions_controller_spec.rb
index a0b0b4413..ad0d0bc05 100644
--- a/spec/controllers/api/subscriptions_controller_spec.rb
+++ b/spec/controllers/api/subscriptions_controller_spec.rb
@@ -3,11 +3,11 @@ require 'rails_helper'
 RSpec.describe Api::SubscriptionsController, type: :controller do
   render_views
 
-  let(:account) { Fabricate(:account, username: 'gargron', domain: 'quitter.no', verify_token: '123', remote_url: 'topic_url', secret: 'abc') }
+  let(:account) { Fabricate(:account, username: 'gargron', domain: 'quitter.no', remote_url: 'topic_url', secret: 'abc') }
 
   describe 'GET #show' do
     before do
-      get :show, params: { :id => account.id, 'hub.topic' => 'topic_url', 'hub.verify_token' => 123, 'hub.challenge' => '456' }
+      get :show, params: { :id => account.id, 'hub.topic' => 'topic_url', 'hub.challenge' => '456', 'hub.lease_seconds' => "#{86400 * 30}" }
     end
 
     it 'returns http success' do
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb
index 93731d1e4..0939ecdd0 100644
--- a/spec/models/account_spec.rb
+++ b/spec/models/account_spec.rb
@@ -66,14 +66,12 @@ RSpec.describe Account, type: :model do
   end
 
   describe '#subscribed?' do
-    it 'returns false when no secrets and tokens have been set' do
+    it 'returns false when no subscription expiration information is present' do
       expect(subject.subscribed?).to be false
     end
 
-    it 'returns true when the secret and token have been set' do
-      subject.secret       = 'a'
-      subject.verify_token = 'b'
-
+    it 'returns true when subscription expiration has been set' do
+      subject.subscription_expires_at = 30.days.from_now
       expect(subject.subscribed?).to be true
     end
   end