about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-08-17 17:56:23 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-08-17 17:58:00 +0200
commit10ba09f5466fe3d34a5ed78202c35f4e4f9d30e6 (patch)
treeed1a2f603198053a6872d3ac74ee69ba4990fdf3 /spec
parentff2cbc07530d87132af09900b4d0c9ada9d3e716 (diff)
Upgrade to Rails 5.0.0.1
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/accounts_controller_spec.rb8
-rw-r--r--spec/controllers/api/accounts/lookup_controller_spec.rb2
-rw-r--r--spec/controllers/api/accounts_controller_spec.rb12
-rw-r--r--spec/controllers/api/follows_controller_spec.rb2
-rw-r--r--spec/controllers/api/salmon_controller_spec.rb2
-rw-r--r--spec/controllers/api/statuses_controller_spec.rb2
-rw-r--r--spec/controllers/api/subscriptions_controller_spec.rb4
-rw-r--r--spec/controllers/auth/sessions_controller_spec.rb2
-rw-r--r--spec/controllers/settings_controller_spec.rb2
-rw-r--r--spec/controllers/statuses_controller_spec.rb4
-rw-r--r--spec/controllers/stream_entries_controller_spec.rb4
-rw-r--r--spec/controllers/xrd_controller_spec.rb4
-rw-r--r--spec/fabricators/account_fabricator.rb2
-rw-r--r--spec/rails_helper.rb2
14 files changed, 26 insertions, 26 deletions
diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb
index b0a5181da..c5abe63a8 100644
--- a/spec/controllers/accounts_controller_spec.rb
+++ b/spec/controllers/accounts_controller_spec.rb
@@ -5,26 +5,26 @@ RSpec.describe AccountsController, type: :controller do
 
   describe 'GET #show' do
     it 'returns http success' do
-      get :show, username: alice.username
+      get :show, params: { username: alice.username }
       expect(response).to have_http_status(:success)
     end
 
     it 'returns http success with Atom' do
-      get :show, username: alice.username, format: 'atom'
+      get :show, params: { username: alice.username }, format: 'atom'
       expect(response).to have_http_status(:success)
     end
   end
 
   describe 'GET #followers' do
     it 'returns http success' do
-      get :followers, username: alice.username
+      get :followers, params: { username: alice.username }
       expect(response).to have_http_status(:success)
     end
   end
 
   describe 'GET #following' do
     it 'returns http success' do
-      get :following, username: alice.username
+      get :following, params: { username: alice.username }
       expect(response).to have_http_status(:success)
     end
   end
diff --git a/spec/controllers/api/accounts/lookup_controller_spec.rb b/spec/controllers/api/accounts/lookup_controller_spec.rb
index 46c904b5a..043df8c86 100644
--- a/spec/controllers/api/accounts/lookup_controller_spec.rb
+++ b/spec/controllers/api/accounts/lookup_controller_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe Api::Accounts::LookupController, type: :controller do
     before do
       Fabricate(:account, username: 'bob')
       Fabricate(:account, username: 'mcbeth')
-      get :index, usernames: 'alice,bob,mcbeth'
+      get :index, params: { usernames: 'alice,bob,mcbeth' }
     end
 
     it 'returns http success' do
diff --git a/spec/controllers/api/accounts_controller_spec.rb b/spec/controllers/api/accounts_controller_spec.rb
index 7bcb1a788..dd060ddaa 100644
--- a/spec/controllers/api/accounts_controller_spec.rb
+++ b/spec/controllers/api/accounts_controller_spec.rb
@@ -10,28 +10,28 @@ RSpec.describe Api::AccountsController, type: :controller do
 
   describe 'GET #show' do
     it 'returns http success' do
-      get :show, id: user.account.id
+      get :show, params: { id: user.account.id }
       expect(response).to have_http_status(:success)
     end
   end
 
   describe 'GET #statuses' do
     it 'returns http success' do
-      get :statuses, id: user.account.id
+      get :statuses, params: { id: user.account.id }
       expect(response).to have_http_status(:success)
     end
   end
 
   describe 'GET #followers' do
     it 'returns http success' do
-      get :followers, id: user.account.id
+      get :followers, params: { id: user.account.id }
       expect(response).to have_http_status(:success)
     end
   end
 
   describe 'GET #following' do
     it 'returns http success' do
-      get :following, id: user.account.id
+      get :following, params: { id: user.account.id }
       expect(response).to have_http_status(:success)
     end
   end
@@ -40,7 +40,7 @@ RSpec.describe Api::AccountsController, type: :controller do
     let(:other_account) { Fabricate(:account, username: 'bob') }
 
     before do
-      post :follow, id: other_account.id
+      post :follow, params: { id: other_account.id }
     end
 
     it 'returns http success' do
@@ -57,7 +57,7 @@ RSpec.describe Api::AccountsController, type: :controller do
 
     before do
       user.account.follow!(other_account)
-      post :unfollow, id: other_account.id
+      post :unfollow, params: { id: other_account.id }
     end
 
     it 'returns http success' do
diff --git a/spec/controllers/api/follows_controller_spec.rb b/spec/controllers/api/follows_controller_spec.rb
index e9bb1bfa5..286465251 100644
--- a/spec/controllers/api/follows_controller_spec.rb
+++ b/spec/controllers/api/follows_controller_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe Api::FollowsController, type: :controller do
       stub_request(:post, "https://quitter.no/main/salmon/user/7477").to_return(:status => 200, :body => "", :headers => {})
       stub_request(:post, "https://pubsubhubbub.superfeedr.com/").to_return(:status => 200, :body => "", :headers => {})
 
-      post :create, uri: 'gargron@quitter.no'
+      post :create, params: { uri: 'gargron@quitter.no' }
     end
 
     it 'returns http success' do
diff --git a/spec/controllers/api/salmon_controller_spec.rb b/spec/controllers/api/salmon_controller_spec.rb
index d5be69c01..8b356640f 100644
--- a/spec/controllers/api/salmon_controller_spec.rb
+++ b/spec/controllers/api/salmon_controller_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe Api::SalmonController, type: :controller do
   describe 'POST #update' do
     before do
       request.env['RAW_POST_DATA'] = File.read(File.join(Rails.root, 'spec', 'fixtures', 'salmon', 'mention.xml'))
-      post :update, id: account.id
+      post :update, params: { id: account.id }
     end
 
     it 'returns http success' do
diff --git a/spec/controllers/api/statuses_controller_spec.rb b/spec/controllers/api/statuses_controller_spec.rb
index 75a8b999a..c02c1d889 100644
--- a/spec/controllers/api/statuses_controller_spec.rb
+++ b/spec/controllers/api/statuses_controller_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe Api::StatusesController, type: :controller do
     let(:status) { Fabricate(:status, account: user.account) }
 
     it 'returns http success' do
-      get :show, id: status.id
+      get :show, params: { id: status.id }
       expect(response).to have_http_status(:success)
     end
   end
diff --git a/spec/controllers/api/subscriptions_controller_spec.rb b/spec/controllers/api/subscriptions_controller_spec.rb
index de4c8f56d..e13ec4939 100644
--- a/spec/controllers/api/subscriptions_controller_spec.rb
+++ b/spec/controllers/api/subscriptions_controller_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe Api::SubscriptionsController, type: :controller do
 
   describe 'GET #show' do
     before do
-      get :show, :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.verify_token' => 123, 'hub.challenge' => '456' }
     end
 
     it 'returns http success' do
@@ -26,7 +26,7 @@ RSpec.describe Api::SubscriptionsController, type: :controller do
       request.env['HTTP_X_HUB_SIGNATURE'] = "sha1=#{OpenSSL::HMAC.hexdigest('sha1', 'abc', feed)}"
       request.env['RAW_POST_DATA'] = feed
 
-      post :update, id: account.id
+      post :update, params: { id: account.id }
     end
 
     it 'returns http created' do
diff --git a/spec/controllers/auth/sessions_controller_spec.rb b/spec/controllers/auth/sessions_controller_spec.rb
index 004a44fba..48c9b34a1 100644
--- a/spec/controllers/auth/sessions_controller_spec.rb
+++ b/spec/controllers/auth/sessions_controller_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
 
     before do
       request.env["devise.mapping"] = Devise.mappings[:user]
-      post :create, user: { email: user.email, password: user.password }
+      post :create, params: { user: { email: user.email, password: user.password } }
     end
 
     it 'redirects to home page' do
diff --git a/spec/controllers/settings_controller_spec.rb b/spec/controllers/settings_controller_spec.rb
index b417cbdaf..0b41a2111 100644
--- a/spec/controllers/settings_controller_spec.rb
+++ b/spec/controllers/settings_controller_spec.rb
@@ -3,7 +3,7 @@ require 'rails_helper'
 RSpec.describe SettingsController, type: :controller do
 
   before do
-    sign_in :user, Fabricate(:user)
+    sign_in Fabricate(:user), scope: :user
   end
 
   describe "GET #show" do
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb
index 05566a30e..812d75127 100644
--- a/spec/controllers/statuses_controller_spec.rb
+++ b/spec/controllers/statuses_controller_spec.rb
@@ -4,13 +4,13 @@ RSpec.describe StatusesController, type: :controller do
   let(:user) { Fabricate(:user) }
 
   before do
-    sign_in :user, user
+    sign_in user, scope: :user
   end
 
   describe 'POST #create' do
     before do
       stub_request(:post, "https://pubsubhubbub.superfeedr.com/").to_return(:status => 200, :body => "", :headers => {})
-      post :create, status: { text: 'Hello world' }
+      post :create, params: { status: { text: 'Hello world' } }
     end
 
     it 'redirects back to homepage' do
diff --git a/spec/controllers/stream_entries_controller_spec.rb b/spec/controllers/stream_entries_controller_spec.rb
index 1b5f1fd7a..56b636ab4 100644
--- a/spec/controllers/stream_entries_controller_spec.rb
+++ b/spec/controllers/stream_entries_controller_spec.rb
@@ -6,12 +6,12 @@ RSpec.describe StreamEntriesController, type: :controller do
 
   describe 'GET #show' do
     it 'returns http success with HTML' do
-      get :show, account_username: alice.username, id: status.stream_entry.id
+      get :show, params: { account_username: alice.username, id: status.stream_entry.id }
       expect(response).to have_http_status(:success)
     end
 
     it 'returns http success with Atom' do
-      get :show, account_username: alice.username, id: status.stream_entry.id, format: 'atom'
+      get :show, params: { account_username: alice.username, id: status.stream_entry.id }, format: 'atom'
       expect(response).to have_http_status(:success)
     end
   end
diff --git a/spec/controllers/xrd_controller_spec.rb b/spec/controllers/xrd_controller_spec.rb
index c6bc5eab5..9152a714b 100644
--- a/spec/controllers/xrd_controller_spec.rb
+++ b/spec/controllers/xrd_controller_spec.rb
@@ -12,12 +12,12 @@ RSpec.describe XrdController, type: :controller do
     let(:alice) { Fabricate(:account, username: 'alice') }
 
     it 'returns http success when account can be found' do
-      get :webfinger, resource: "acct:#{alice.username}@anything.com"
+      get :webfinger, params: { resource: "acct:#{alice.username}@anything.com" }
       expect(response).to have_http_status(:success)
     end
 
     it 'returns http not found when account cannot be found' do
-      get :webfinger, resource: 'acct:not@existing.com'
+      get :webfinger, params: { resource: 'acct:not@existing.com' }
       expect(response).to have_http_status(:not_found)
     end
   end
diff --git a/spec/fabricators/account_fabricator.rb b/spec/fabricators/account_fabricator.rb
index 5f87ea522..3a7c00bf5 100644
--- a/spec/fabricators/account_fabricator.rb
+++ b/spec/fabricators/account_fabricator.rb
@@ -1,3 +1,3 @@
 Fabricator(:account) do
-
+  username "alice"
 end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 71e99e16e..e9c732f6f 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -17,7 +17,7 @@ RSpec.configure do |config|
   config.infer_spec_type_from_file_location!
   config.filter_rails_from_backtrace!
 
-  config.include Devise::TestHelpers, type: :controller
+  config.include Devise::Test::ControllerHelpers, type: :controller
   config.include Devise::TestHelpers, type: :view
 end