about summary refs log tree commit diff
path: root/spec/controllers/accounts_controller_spec.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-09-09 14:27:47 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-09-09 14:27:47 -0500
commitb9f7bc149b2a6abfbdaee83e6992b617b8bdb18e (patch)
tree355225f4424a6ea1b40c66c5540ccab42096e3bf /spec/controllers/accounts_controller_spec.rb
parente18ed4bbc7ab4e258d05a3e2a5db0790f67a8f37 (diff)
parent5d170587e3b6c1a3b3ebe0910b62a4c526e2900d (diff)
Merge branch 'origin/master' into sync/upstream
 Conflicts:
	app/javascript/mastodon/components/status_list.js
	app/javascript/mastodon/features/notifications/index.js
	app/javascript/mastodon/features/ui/components/modal_root.js
	app/javascript/mastodon/features/ui/components/onboarding_modal.js
	app/javascript/mastodon/features/ui/index.js
	app/javascript/styles/about.scss
	app/javascript/styles/accounts.scss
	app/javascript/styles/components.scss
	app/presenters/instance_presenter.rb
	app/services/post_status_service.rb
	app/services/reblog_service.rb
	app/views/about/more.html.haml
	app/views/about/show.html.haml
	app/views/accounts/_header.html.haml
	config/webpack/loaders/babel.js
	spec/controllers/api/v1/accounts/credentials_controller_spec.rb
Diffstat (limited to 'spec/controllers/accounts_controller_spec.rb')
-rw-r--r--spec/controllers/accounts_controller_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb
index d61c8c9bd..4e37b1b5f 100644
--- a/spec/controllers/accounts_controller_spec.rb
+++ b/spec/controllers/accounts_controller_spec.rb
@@ -10,6 +10,13 @@ RSpec.describe AccountsController, type: :controller do
     let!(:status2) { Status.create!(account: alice, text: 'Boop', thread: status1) }
     let!(:status3) { Status.create!(account: alice, text: 'Picture!') }
     let!(:status4) { Status.create!(account: alice, text: 'Mentioning @alice') }
+    let!(:status5) { Status.create!(account: alice, text: 'Kitsune') }
+    let!(:status6) { Status.create!(account: alice, text: 'Neko') }
+    let!(:status7) { Status.create!(account: alice, text: 'Tanuki') }
+
+    let!(:status_pin1) { StatusPin.create!(account: alice, status: status5, created_at: 5.days.ago) }
+    let!(:status_pin2) { StatusPin.create!(account: alice, status: status6, created_at: 2.years.ago) }
+    let!(:status_pin3) { StatusPin.create!(account: alice, status: status7, created_at: 10.minutes.ago) }
 
     before do
       status3.media_attachments.create!(account: alice, file: fixture_file_upload('files/attachment.jpg', 'image/jpeg'))
@@ -48,6 +55,10 @@ RSpec.describe AccountsController, type: :controller do
       it 'returns http success with Activity Streams 2.0' do
         expect(response).to have_http_status(:success)
       end
+
+      it 'returns application/activity+json' do
+        expect(response.content_type).to eq 'application/activity+json'
+      end
     end
 
     context 'html' do
@@ -66,6 +77,14 @@ RSpec.describe AccountsController, type: :controller do
         expect(statuses[1]).to eq status2
       end
 
+      it 'assigns @pinned_statuses' do
+        pinned_statuses = assigns(:pinned_statuses).to_a
+        expect(pinned_statuses.size).to eq 3
+        expect(pinned_statuses[0]).to eq status7
+        expect(pinned_statuses[1]).to eq status5
+        expect(pinned_statuses[2]).to eq status6
+      end
+
       it 'returns http success' do
         expect(response).to have_http_status(:success)
       end