diff --git a/app/assets/stylesheets/api/accounts.scss b/app/assets/stylesheets/api/accounts.scss
deleted file mode 100644
index 614f23d341..0000000000
--- a/app/assets/stylesheets/api/accounts.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the Api::Accounts controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/api/follows.scss b/app/assets/stylesheets/api/follows.scss
deleted file mode 100644
index 4da2e7e2c2..0000000000
--- a/app/assets/stylesheets/api/follows.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the API::Follows controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/api/salmon.scss b/app/assets/stylesheets/api/salmon.scss
deleted file mode 100644
index 13cb648a88..0000000000
--- a/app/assets/stylesheets/api/salmon.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the API::Salmon controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/api/statuses.scss b/app/assets/stylesheets/api/statuses.scss
deleted file mode 100644
index dfa3227d89..0000000000
--- a/app/assets/stylesheets/api/statuses.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the API::Statuses controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/api/subscriptions.scss b/app/assets/stylesheets/api/subscriptions.scss
deleted file mode 100644
index 9bee8c9bd4..0000000000
--- a/app/assets/stylesheets/api/subscriptions.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the API::Subscriptions controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 9114acde4a..5e89c210bc 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -1,12 +1,3 @@
-$primary-color: #ff7473;
-$secondary-color: #ffc952;
-$tertiary-color: #47b8e0;
-$quaternary-color: #34314c;
-$background-color: #fff;
-$darker-background-color: #e3dede;
-$text-color: #333030;
-$lighter-text-color: #8b8687;
-
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,400italic);
@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,500);
@import "font-awesome";
diff --git a/app/assets/stylesheets/oauth/applications.scss b/app/assets/stylesheets/oauth/applications.scss
deleted file mode 100644
index 50933741e5..0000000000
--- a/app/assets/stylesheets/oauth/applications.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the oauth::applications controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/controllers/api/subscriptions_controller.rb b/app/controllers/api/subscriptions_controller.rb
index 038d6c8776..6ae038a36f 100644
--- a/app/controllers/api/subscriptions_controller.rb
+++ b/app/controllers/api/subscriptions_controller.rb
@@ -12,7 +12,7 @@ class Api::SubscriptionsController < ApiController
def update
body = request.body.read
- if @account.subscription(api_subscription_url(@account.id)).verify(body, env['HTTP_X_HUB_SIGNATURE'])
+ if @account.subscription(api_subscription_url(@account.id)).verify(body, request.headers['HTTP_X_HUB_SIGNATURE'])
ProcessFeedService.new.(body, @account)
render nothing: true, status: 201
else
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 80d0843283..35f1e62c56 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -1,5 +1,6 @@
class ApiController < ApplicationController
protect_from_forgery with: :null_session
+ skip_before_filter :verify_authenticity_token
protected
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 504d58aed9..db69dfc6a2 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -17,7 +17,7 @@ class ProcessFeedService < BaseService
status = Status.find_by(uri: activity_id(entry))
# If we already have a post and the verb is now "delete", we gotta delete it and move on!
- if verb(entry) == :delete
+ if !status.nil? && verb(entry) == :delete
delete_post!(status)
next
end
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 4a994e1e7b..d2452f355b 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,4 +1,4 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
-Rails.application.config.filter_parameters += [:password]
+Rails.application.config.filter_parameters += [:password, :private_key, :public_key]
diff --git a/spec/controllers/api/accounts_controller_spec.rb b/spec/controllers/api/accounts_controller_spec.rb
index 915a40a8a4..7bcb1a788d 100644
--- a/spec/controllers/api/accounts_controller_spec.rb
+++ b/spec/controllers/api/accounts_controller_spec.rb
@@ -1,27 +1,71 @@
require 'rails_helper'
RSpec.describe Api::AccountsController, type: :controller do
+ let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
+ let(:token) { double acceptable?: true, resource_owner_id: user.id }
+
+ before do
+ allow(controller).to receive(:doorkeeper_token) { token }
+ end
+
describe 'GET #show' do
- it 'returns http success'
+ it 'returns http success' do
+ get :show, id: user.account.id
+ expect(response).to have_http_status(:success)
+ end
end
describe 'GET #statuses' do
- it 'returns http success'
+ it 'returns http success' do
+ get :statuses, id: user.account.id
+ expect(response).to have_http_status(:success)
+ end
end
describe 'GET #followers' do
- it 'returns http success'
+ it 'returns http success' do
+ get :followers, id: user.account.id
+ expect(response).to have_http_status(:success)
+ end
end
describe 'GET #following' do
- it 'returns http success'
+ it 'returns http success' do
+ get :following, id: user.account.id
+ expect(response).to have_http_status(:success)
+ end
end
describe 'POST #follow' do
- it 'returns http success'
+ let(:other_account) { Fabricate(:account, username: 'bob') }
+
+ before do
+ post :follow, id: other_account.id
+ end
+
+ it 'returns http success' do
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'creates a following relation between user and target user' do
+ expect(user.account.following?(other_account)).to be true
+ end
end
describe 'POST #unfollow' do
- it 'returns http success'
+ let(:other_account) { Fabricate(:account, username: 'bob') }
+
+ before do
+ user.account.follow!(other_account)
+ post :unfollow, id: other_account.id
+ end
+
+ it 'returns http success' do
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'removes the following relation between user and target user' do
+ expect(user.account.following?(other_account)).to be false
+ end
end
end
diff --git a/spec/controllers/api/follows_controller_spec.rb b/spec/controllers/api/follows_controller_spec.rb
index 75f4701817..e9bb1bfa53 100644
--- a/spec/controllers/api/follows_controller_spec.rb
+++ b/spec/controllers/api/follows_controller_spec.rb
@@ -1,7 +1,48 @@
require 'rails_helper'
RSpec.describe Api::FollowsController, type: :controller do
+ let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
+ let(:token) { double acceptable?: true, resource_owner_id: user.id }
+
+ before do
+ allow(controller).to receive(:doorkeeper_token) { token }
+ end
+
describe 'POST #create' do
- it 'returns http success'
+ before do
+ stub_request(:get, "https://quitter.no/.well-known/host-meta").to_return(request_fixture('.host-meta.txt'))
+ stub_request(:get, "https://quitter.no/.well-known/webfinger?resource=acct:gargron@quitter.no").to_return(request_fixture('webfinger.txt'))
+ stub_request(:get, "https://quitter.no/api/statuses/user_timeline/7477.atom").to_return(request_fixture('feed.txt'))
+ stub_request(:get, "https://quitter.no/avatar/7477-300-20160211190340.png").to_return(request_fixture('avatar.txt'))
+ stub_request(:post, "https://quitter.no/main/push/hub").to_return(:status => 200, :body => "", :headers => {})
+ 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'
+ end
+
+ it 'returns http success' do
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'creates account for remote user' do
+ expect(Account.find_by(username: 'gargron', domain: 'quitter.no')).to_not be_nil
+ end
+
+ it 'creates a follow relation between user and remote user' do
+ expect(user.account.following?(Account.find_by(username: 'gargron', domain: 'quitter.no'))).to be true
+ end
+
+ it 'sends a salmon slap to the remote user' do
+ expect(a_request(:post, "https://quitter.no/main/salmon/user/7477")).to have_been_made
+ end
+
+ it 'notifies own hub' do
+ expect(a_request(:post, "https://pubsubhubbub.superfeedr.com/")).to have_been_made
+ end
+
+ it 'subscribes to remote hub' do
+ expect(a_request(:post, "https://quitter.no/main/push/hub")).to have_been_made
+ end
end
end
diff --git a/spec/controllers/api/salmon_controller_spec.rb b/spec/controllers/api/salmon_controller_spec.rb
index e81ad12add..d5be69c014 100644
--- a/spec/controllers/api/salmon_controller_spec.rb
+++ b/spec/controllers/api/salmon_controller_spec.rb
@@ -1,7 +1,35 @@
require 'rails_helper'
RSpec.describe Api::SalmonController, type: :controller do
+ let(:account) { Fabricate(:account, username: 'catsrgr8', user: Fabricate(:user)) }
+
+ before do
+ stub_request(:get, "https://quitter.no/.well-known/host-meta").to_return(request_fixture('.host-meta.txt'))
+ stub_request(:get, "https://quitter.no/.well-known/webfinger?resource=acct:gargron@quitter.no").to_return(request_fixture('webfinger.txt'))
+ stub_request(:get, "https://quitter.no/api/statuses/user_timeline/7477.atom").to_return(request_fixture('feed.txt'))
+ stub_request(:get, "https://quitter.no/avatar/7477-300-20160211190340.png").to_return(request_fixture('avatar.txt'))
+ end
+
describe 'POST #update' do
- pending
+ before do
+ request.env['RAW_POST_DATA'] = File.read(File.join(Rails.root, 'spec', 'fixtures', 'salmon', 'mention.xml'))
+ post :update, id: account.id
+ end
+
+ it 'returns http success' do
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'creates remote account' do
+ expect(Account.find_by(username: 'gargron', domain: 'quitter.no')).to_not be_nil
+ end
+
+ it 'creates status' do
+ expect(Status.find_by(uri: 'tag:quitter.no,2016-03-20:noticeId=1276923:objectType=note')).to_not be_nil
+ end
+
+ it 'creates mention for target account' do
+ expect(account.mentions.count).to eq 1
+ end
end
end
diff --git a/spec/controllers/api/statuses_controller_spec.rb b/spec/controllers/api/statuses_controller_spec.rb
index bd136a5598..75a8b999a3 100644
--- a/spec/controllers/api/statuses_controller_spec.rb
+++ b/spec/controllers/api/statuses_controller_spec.rb
@@ -1,8 +1,20 @@
require 'rails_helper'
RSpec.describe Api::StatusesController, type: :controller do
+ let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
+ let(:token) { double acceptable?: true, resource_owner_id: user.id }
+
+ before do
+ allow(controller).to receive(:doorkeeper_token) { token }
+ end
+
describe 'GET #show' do
- it 'returns http success'
+ let(:status) { Fabricate(:status, account: user.account) }
+
+ it 'returns http success' do
+ get :show, id: status.id
+ expect(response).to have_http_status(:success)
+ end
end
describe 'GET #home' do
diff --git a/spec/controllers/api/subscriptions_controller_spec.rb b/spec/controllers/api/subscriptions_controller_spec.rb
index 16995c687d..e2f2ddd7ec 100644
--- a/spec/controllers/api/subscriptions_controller_spec.rb
+++ b/spec/controllers/api/subscriptions_controller_spec.rb
@@ -1,11 +1,40 @@
require 'rails_helper'
RSpec.describe Api::SubscriptionsController, type: :controller do
+ let(:account) { Fabricate(:account, username: 'gargron', domain: 'quitter.no', verify_token: '123', remote_url: 'topic_url', secret: 'abc') }
+
describe 'GET #show' do
- pending
+ before do
+ get :show, id: account.id, 'hub.topic': 'topic_url', 'hub.verify_token': 123, 'hub.challenge': '456'
+ end
+
+ it 'returns http success' do
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'echoes back the challenge' do
+ expect(response.body).to match '456'
+ end
end
describe 'POST #update' do
- pending
+ let(:feed) { File.read(File.join(Rails.root, 'spec', 'fixtures', 'push', 'feed.atom')) }
+
+ before do
+ stub_request(:get, "https://quitter.no/avatar/7477-300-20160211190340.png").to_return(request_fixture('avatar.txt'))
+
+ request.env['HTTP_X_HUB_SIGNATURE'] = "sha1=#{OpenSSL::HMAC.hexdigest('sha1', 'abc', feed)}"
+ request.env['RAW_POST_DATA'] = feed
+
+ post :update, id: account.id
+ end
+
+ it 'returns http created' do
+ expect(response).to have_http_status(:created)
+ end
+
+ it 'creates statuses for feed' do
+ expect(account.statuses.count).to_not eq 0
+ end
end
end
diff --git a/spec/fixtures/push/feed.atom b/spec/fixtures/push/feed.atom
new file mode 100644
index 0000000000..349df139d0
--- /dev/null
+++ b/spec/fixtures/push/feed.atom
@@ -0,0 +1,424 @@
+
+
+ GNU social
+ https://quitter.no/api/statuses/user_timeline/7477.atom
+ gargron timeline
+ Updates from gargron on Quitter.no!
+ https://quitter.no/avatar/7477-96-20160211190340.png
+ 2016-03-20T12:42:58+01:00
+
+ http://activitystrea.ms/schema/1.0/person
+ https://quitter.no/user/7477
+ gargron
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+
+
+
+ gargron
+ DIGITAL CAT
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+ Germany
+
+
+ homepage
+ https://zeonfederated.com
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-20:noticeId=1276923:objectType=note
+ New note by gargron
+ @<a href="https://cb6e6126.ngrok.io/users/catsrgr8" class="h-card mention">catsrgr8</a> this is a mention
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-20T11:05:31+00:00
+ 2016-03-20T11:05:31+00:00
+
+ tag:quitter.no,2016-03-20:objectType=thread:nonce=7c998112e39a6685
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1273635:objectType=note
+ New note by gargron
+ Just testing a thing.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-19T20:35:53+00:00
+ 2016-03-19T20:35:53+00:00
+
+ tag:quitter.no,2016-03-19:objectType=thread:nonce=c4a61886d5cad4c2
+
+
+
+
+
+
+
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+ Delete
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> deleted notice <a href="https://quitter.no/notice/1272988">{{tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note}}</a>.
+
+ delete
+ 2016-03-19T18:16:58+00:00
+ 2016-03-19T18:16:58+00:00
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+
+
+ tag:quitter.no,2016-03-19:objectType=thread:nonce=7913e6b6256b6d0b
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-19:noticeId=1269381:objectType=comment
+ New comment by gargron
+ @<a href="https://mastodon.social/users/Gargron" class="h-card mention" title="Eugen">gargron</a> I have to wonder if this will appear as a reply to the right status, and not just a mention.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-19T00:10:14+00:00
+ 2016-03-19T00:10:14+00:00
+
+
+
+ tag:quitter.no,2016-03-18:objectType=thread:nonce=d05c6330fbe23fb9
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-18:noticeId=1265337:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> Plus, Android can hardly be considered free software given how many proprietary blobs are used. I'm speaking as a disappointed Android user.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-18T10:01:50+00:00
+ 2016-03-18T10:01:50+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-18:objectType=thread:nonce=d61438407b882959
+
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-18:noticeId=1265331:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> Well as it turns out, Apple software is better than Android in terms of security, and Apple is fighting FBI while Google promised to build a messaging app that facilitates wire tapping. The whole free software thing should imo be considered a bonus and not overshadow other factors.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-18T10:01:01+00:00
+ 2016-03-18T10:01:01+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-18:objectType=thread:nonce=d61438407b882959
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-17:noticeId=1261358:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> @<a href="https://gs.kawa-kun.com/user/2" class="h-card mention" title="竹下憲二">takeshitakenji</a> There is a reason that was deprecated and we don't use tables to design websites anymore. HTML needs to be semantic, i.e. tags need to describe the *kind* of content, not how it should *look*, which is a responsibility delegated to CSS. There are so many upsides to this separation of concerns, should I start listing?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-17T17:00:26+00:00
+ 2016-03-17T17:00:26+00:00
+
+
+
+ tag:gs.kawa-kun.com,2016-03-17:objectType=thread:nonce=a83963573a0520f1
+
+
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:24:13+01:00
+ DIGITAL CAT (gargron)'s status on Wednesday, 16-Mar-2016 21:24:13 CET
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:24:13+00:00
+ 2016-03-16T20:24:13+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ https://mastodon.social/users/Gargron
+ Eugen
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+
+
+
+ gargron
+ Eugen
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=073bda8223dfcaa7
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:22:38+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:22:38+00:00
+ 2016-03-16T20:22:38+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:22:38+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=b157f676181e0ecd
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:16:14+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:16:15+00:00
+ 2016-03-16T20:16:15+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:16:14+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=6a6ebd1ed6504a11
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:13:06+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:13:06+00:00
+ 2016-03-16T20:13:06+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:13:06+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=8f5f92443584e8f0
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:05:02+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:05:03+00:00
+ 2016-03-16T20:05:03+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:05:02+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=b630d235232fcff5
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T19:04:16+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T18:04:16+00:00
+ 2016-03-16T18:04:16+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T19:04:16+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=40eb98e5f85c9908
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-15:noticeId=1251422:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> LGB, not LGBT?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T20:28:13+00:00
+ 2016-03-15T20:28:13+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-15:objectType=thread:nonce=70ff6886d69e5225
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-15:noticeId=1250742:objectType=comment
+ New comment by gargron
+ @<a href="https://social.umeahackerspace.se/user/2" class="h-card mention" title="<Mikael & Nordfeldth>">mmn</a> I'm like reeeeally close to actually deploying the first production instance of Mastodon, but it bugs me that there's gonna be that issue with avatars and profiles not updating :(
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T18:44:54+00:00
+ 2016-03-15T18:44:54+00:00
+
+
+
+ tag:quitter.no,2016-03-15:objectType=thread:nonce=2fbd771270b5da80
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-15:noticeId=1250653:objectType=note
+ New note by gargron
+ @<a href="https://social.umeahackerspace.se/user/2" class="h-card mention" title="<Mikael & Nordfeldth>">mmn</a> Any progress on the issues I created?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T18:27:00+00:00
+ 2016-03-15T18:27:00+00:00
+
+ tag:quitter.no,2016-03-15:objectType=thread:nonce=2fbd771270b5da80
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-14:noticeId=1243566:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> I heard Piwik is also good.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-14T15:35:23+00:00
+ 2016-03-14T15:35:23+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-14:objectType=thread:nonce=8fbf00e7f76866d3
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-14:noticeId=1243331:objectType=comment
+ New comment by gargron
+ I do wish I had somebody else partake in the development process if only to give me feedback on my decisions
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-14T14:52:03+00:00
+ 2016-03-14T14:52:03+00:00
+
+
+
+ tag:quitter.no,2016-03-14:objectType=thread:nonce=46e8a2abc1839d01
+
+
+
+
+
+
+
diff --git a/spec/fixtures/requests/.host-meta.txt b/spec/fixtures/requests/.host-meta.txt
new file mode 100644
index 0000000000..b312b11fb2
--- /dev/null
+++ b/spec/fixtures/requests/.host-meta.txt
@@ -0,0 +1,19 @@
+HTTP/1.1 200 OK
+Server: nginx/1.6.2
+Date: Sun, 20 Mar 2016 11:11:00 GMT
+Content-Type: application/xrd+xml
+Transfer-Encoding: chunked
+Connection: keep-alive
+Access-Control-Allow-Origin: *
+Vary: Accept-Encoding,Cookie
+Strict-Transport-Security: max-age=31536000; includeSubdomains;
+
+
+
+
+
+
+
+
+
+
diff --git a/spec/fixtures/requests/avatar.txt b/spec/fixtures/requests/avatar.txt
new file mode 100644
index 0000000000..d57b0984fb
Binary files /dev/null and b/spec/fixtures/requests/avatar.txt differ
diff --git a/spec/fixtures/requests/feed.txt b/spec/fixtures/requests/feed.txt
new file mode 100644
index 0000000000..91eeb29bda
--- /dev/null
+++ b/spec/fixtures/requests/feed.txt
@@ -0,0 +1,440 @@
+HTTP/1.1 200 OK
+Server: nginx/1.6.2
+Date: Sun, 20 Mar 2016 11:15:03 GMT
+Content-Type: application/atom+xml; charset=utf-8
+Transfer-Encoding: chunked
+Connection: keep-alive
+Access-Control-Allow-Origin: *
+Vary: Accept-Encoding,Cookie
+ETag: "ApiTimelineUser:0:en:7477:1458471931:1457967123"
+Last-Modified: Sun, 20 Mar 2016 11:05:31 +0000
+Expires: Thu, 01 Jan 1970 00:00:00 GMT
+Cache-Control: private, must-revalidate, max-age=0
+Pragma:
+X-SUP-ID: https://quitter.no/main/sup
+Strict-Transport-Security: max-age=31536000; includeSubdomains;
+
+
+
+ GNU social
+ https://quitter.no/api/statuses/user_timeline/7477.atom
+ gargron timeline
+ Updates from gargron on Quitter.no!
+ https://quitter.no/avatar/7477-96-20160211190340.png
+ 2016-03-20T12:15:03+01:00
+
+ http://activitystrea.ms/schema/1.0/person
+ https://quitter.no/user/7477
+ gargron
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+
+
+
+ gargron
+ DIGITAL CAT
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+ Germany
+
+
+ homepage
+ https://zeonfederated.com
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-20:noticeId=1276923:objectType=note
+ New note by gargron
+ @<a href="https://cb6e6126.ngrok.io/users/catsrgr8" class="h-card mention">catsrgr8</a> this is a mention
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-20T11:05:31+00:00
+ 2016-03-20T11:05:31+00:00
+
+ tag:quitter.no,2016-03-20:objectType=thread:nonce=7c998112e39a6685
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1273635:objectType=note
+ New note by gargron
+ Just testing a thing.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-19T20:35:53+00:00
+ 2016-03-19T20:35:53+00:00
+
+ tag:quitter.no,2016-03-19:objectType=thread:nonce=c4a61886d5cad4c2
+
+
+
+
+
+
+
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+ Delete
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> deleted notice <a href="https://quitter.no/notice/1272988">{{tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note}}</a>.
+
+ delete
+ 2016-03-19T18:16:58+00:00
+ 2016-03-19T18:16:58+00:00
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+
+
+ tag:quitter.no,2016-03-19:objectType=thread:nonce=7913e6b6256b6d0b
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-19:noticeId=1272988:objectType=note
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-19:noticeId=1269381:objectType=comment
+ New comment by gargron
+ @<a href="https://mastodon.social/users/Gargron" class="h-card mention" title="Eugen">gargron</a> I have to wonder if this will appear as a reply to the right status, and not just a mention.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-19T00:10:14+00:00
+ 2016-03-19T00:10:14+00:00
+
+
+
+ tag:quitter.no,2016-03-18:objectType=thread:nonce=d05c6330fbe23fb9
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-18:noticeId=1265337:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> Plus, Android can hardly be considered free software given how many proprietary blobs are used. I'm speaking as a disappointed Android user.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-18T10:01:50+00:00
+ 2016-03-18T10:01:50+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-18:objectType=thread:nonce=d61438407b882959
+
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-18:noticeId=1265331:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> Well as it turns out, Apple software is better than Android in terms of security, and Apple is fighting FBI while Google promised to build a messaging app that facilitates wire tapping. The whole free software thing should imo be considered a bonus and not overshadow other factors.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-18T10:01:01+00:00
+ 2016-03-18T10:01:01+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-18:objectType=thread:nonce=d61438407b882959
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-17:noticeId=1261358:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> @<a href="https://gs.kawa-kun.com/user/2" class="h-card mention" title="竹下憲二">takeshitakenji</a> There is a reason that was deprecated and we don't use tables to design websites anymore. HTML needs to be semantic, i.e. tags need to describe the *kind* of content, not how it should *look*, which is a responsibility delegated to CSS. There are so many upsides to this separation of concerns, should I start listing?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-17T17:00:26+00:00
+ 2016-03-17T17:00:26+00:00
+
+
+
+ tag:gs.kawa-kun.com,2016-03-17:objectType=thread:nonce=a83963573a0520f1
+
+
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:24:13+01:00
+ DIGITAL CAT (gargron)'s status on Wednesday, 16-Mar-2016 21:24:13 CET
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:24:13+00:00
+ 2016-03-16T20:24:13+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ https://mastodon.social/users/Gargron
+ Eugen
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+
+
+
+ gargron
+ Eugen
+ Software engineer, free time musician and DIGITAL SPORTS enthusiast. Likes cats. Warning: May contain memes
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=073bda8223dfcaa7
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:22:38+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:22:38+00:00
+ 2016-03-16T20:22:38+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:22:38+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=b157f676181e0ecd
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:16:14+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:16:15+00:00
+ 2016-03-16T20:16:15+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T21:16:14+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=6a6ebd1ed6504a11
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:13:06+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:13:06+00:00
+ 2016-03-16T20:13:06+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:13:06+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=8f5f92443584e8f0
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:05:02+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T20:05:03+00:00
+ 2016-03-16T20:05:03+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15750:2016-03-16T21:05:02+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://acda7931.ngrok.io/users/catsrgr8">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=b630d235232fcff5
+
+
+
+
+
+
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T19:04:16+01:00
+
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+ http://activitystrea.ms/schema/1.0/follow
+ 2016-03-16T18:04:16+00:00
+ 2016-03-16T18:04:16+00:00
+
+ http://activitystrea.ms/schema/1.0/person
+ tag:quitter.no,2016-03-16:subscription:7477:person:15743:2016-03-16T19:04:16+01:00
+ New person by gargron
+ <a href="https://quitter.no/gargron">DIGITAL CAT</a> started following <a href="https://mastodon.social/users/Gargron">Eugen</a>.
+
+
+
+
+ tag:quitter.no,2016-03-16:objectType=thread:nonce=40eb98e5f85c9908
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-15:noticeId=1251422:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> LGB, not LGBT?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T20:28:13+00:00
+ 2016-03-15T20:28:13+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-15:objectType=thread:nonce=70ff6886d69e5225
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-15:noticeId=1250742:objectType=comment
+ New comment by gargron
+ @<a href="https://social.umeahackerspace.se/user/2" class="h-card mention" title="<Mikael & Nordfeldth>">mmn</a> I'm like reeeeally close to actually deploying the first production instance of Mastodon, but it bugs me that there's gonna be that issue with avatars and profiles not updating :(
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T18:44:54+00:00
+ 2016-03-15T18:44:54+00:00
+
+
+
+ tag:quitter.no,2016-03-15:objectType=thread:nonce=2fbd771270b5da80
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/note
+ tag:quitter.no,2016-03-15:noticeId=1250653:objectType=note
+ New note by gargron
+ @<a href="https://social.umeahackerspace.se/user/2" class="h-card mention" title="<Mikael & Nordfeldth>">mmn</a> Any progress on the issues I created?
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-15T18:27:00+00:00
+ 2016-03-15T18:27:00+00:00
+
+ tag:quitter.no,2016-03-15:objectType=thread:nonce=2fbd771270b5da80
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-14:noticeId=1243566:objectType=comment
+ New comment by gargron
+ @<a href="https://community.highlandarrow.com/user/1" class="h-card mention" title="Maiyannah Bishop">maiyannah</a> I heard Piwik is also good.
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-14T15:35:23+00:00
+ 2016-03-14T15:35:23+00:00
+
+
+
+ tag:community.highlandarrow.com,2016-03-14:objectType=thread:nonce=8fbf00e7f76866d3
+
+
+
+
+
+
+
+ http://activitystrea.ms/schema/1.0/comment
+ tag:quitter.no,2016-03-14:noticeId=1243331:objectType=comment
+ New comment by gargron
+ I do wish I had somebody else partake in the development process if only to give me feedback on my decisions
+
+
+ http://activitystrea.ms/schema/1.0/post
+ 2016-03-14T14:52:03+00:00
+ 2016-03-14T14:52:03+00:00
+
+
+
+ tag:quitter.no,2016-03-14:objectType=thread:nonce=46e8a2abc1839d01
+
+
+
+
+
+
+
diff --git a/spec/fixtures/requests/webfinger.txt b/spec/fixtures/requests/webfinger.txt
new file mode 100644
index 0000000000..edb8a2dbb5
--- /dev/null
+++ b/spec/fixtures/requests/webfinger.txt
@@ -0,0 +1,11 @@
+HTTP/1.1 200 OK
+Server: nginx/1.6.2
+Date: Sun, 20 Mar 2016 11:13:16 GMT
+Content-Type: application/jrd+json
+Transfer-Encoding: chunked
+Connection: keep-alive
+Access-Control-Allow-Origin: *
+Vary: Accept-Encoding,Cookie
+Strict-Transport-Security: max-age=31536000; includeSubdomains;
+
+{"subject":"acct:gargron@quitter.no","aliases":["https:\/\/quitter.no\/user\/7477","https:\/\/quitter.no\/gargron","https:\/\/quitter.no\/index.php\/user\/7477","https:\/\/quitter.no\/index.php\/gargron"],"links":[{"rel":"http:\/\/webfinger.net\/rel\/profile-page","type":"text\/html","href":"https:\/\/quitter.no\/gargron"},{"rel":"http:\/\/gmpg.org\/xfn\/11","type":"text\/html","href":"https:\/\/quitter.no\/gargron"},{"rel":"describedby","type":"application\/rdf+xml","href":"https:\/\/quitter.no\/gargron\/foaf"},{"rel":"http:\/\/apinamespace.org\/atom","type":"application\/atomsvc+xml","href":"https:\/\/quitter.no\/api\/statusnet\/app\/service\/gargron.xml"},{"rel":"http:\/\/apinamespace.org\/twitter","href":"https:\/\/quitter.no\/api\/"},{"rel":"http:\/\/specs.openid.net\/auth\/2.0\/provider","href":"https:\/\/quitter.no\/gargron"},{"rel":"http:\/\/schemas.google.com\/g\/2010#updates-from","type":"application\/atom+xml","href":"https:\/\/quitter.no\/api\/statuses\/user_timeline\/7477.atom"},{"rel":"magic-public-key","href":"data:application\/magic-public-key,RSA.1ZBkHTavLvxH3FzlKv4O6WtlILKRFfNami3_Rcu8EuogtXSYiS-bB6hElZfUCSHbC4uLemOA34PEhz__CDMozax1iI_t8dzjDnh1x0iFSup7pSfW9iXk_WU3Dm74yWWW2jildY41vWgrEstuQ1dJ8vVFfSJ9T_tO4c-T9y8vDI8=.AQAB"},{"rel":"salmon","href":"https:\/\/quitter.no\/main\/salmon\/user\/7477"},{"rel":"http:\/\/salmon-protocol.org\/ns\/salmon-replies","href":"https:\/\/quitter.no\/main\/salmon\/user\/7477"},{"rel":"http:\/\/salmon-protocol.org\/ns\/salmon-mention","href":"https:\/\/quitter.no\/main\/salmon\/user\/7477"},{"rel":"http:\/\/ostatus.org\/schema\/1.0\/subscribe","template":"https:\/\/quitter.no\/main\/ostatussub?profile={uri}"}]}
\ No newline at end of file
diff --git a/spec/fixtures/salmon/mention.xml b/spec/fixtures/salmon/mention.xml
new file mode 100644
index 0000000000..4d387ad83f
--- /dev/null
+++ b/spec/fixtures/salmon/mention.xml
@@ -0,0 +1,2 @@
+
+PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8-PGVudHJ5IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDA1L0F0b20iIHhtbG5zOnRocj0iaHR0cDovL3B1cmwub3JnL3N5bmRpY2F0aW9uL3RocmVhZC8xLjAiIHhtbG5zOmFjdGl2aXR5PSJodHRwOi8vYWN0aXZpdHlzdHJlYS5tcy9zcGVjLzEuMC8iIHhtbG5zOmdlb3Jzcz0iaHR0cDovL3d3dy5nZW9yc3Mub3JnL2dlb3JzcyIgeG1sbnM6b3N0YXR1cz0iaHR0cDovL29zdGF0dXMub3JnL3NjaGVtYS8xLjAiIHhtbG5zOnBvY289Imh0dHA6Ly9wb3J0YWJsZWNvbnRhY3RzLm5ldC9zcGVjLzEuMCIgeG1sbnM6bWVkaWE9Imh0dHA6Ly9wdXJsLm9yZy9zeW5kaWNhdGlvbi9hdG9tbWVkaWEiIHhtbG5zOnN0YXR1c25ldD0iaHR0cDovL3N0YXR1cy5uZXQvc2NoZW1hL2FwaS8xLyI-CiA8YWN0aXZpdHk6b2JqZWN0LXR5cGU-aHR0cDovL2FjdGl2aXR5c3RyZWEubXMvc2NoZW1hLzEuMC9ub3RlPC9hY3Rpdml0eTpvYmplY3QtdHlwZT4KIDxpZD50YWc6cXVpdHRlci5ubywyMDE2LTAzLTIwOm5vdGljZUlkPTEyNzY5MjM6b2JqZWN0VHlwZT1ub3RlPC9pZD4KIDx0aXRsZT5OZXcgbm90ZSBieSBnYXJncm9uPC90aXRsZT4KIDxjb250ZW50I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GxpbmsgcmVsPSJlZGl0IiB0eXBlPSJhcHBsaWNhdGlvbi9hdG9tK3htbCIgaHJlZj0iaHR0cHM6Ly9xdWl0dGVyLm5vL2FwaS9zdGF0dXNlcy9zaG93LzEyNzY5MjMuYXRvbSIvPgogPHN0YXR1c25ldDpub3RpY2VfaW5mbyBsb2NhbF9pZD0iMTI3NjkyMyIgc291cmNlPSJRdml0dGVyIj48L3N0YXR1c25ldDpub3RpY2VfaW5mbz4KPC9lbnRyeT4Kbase64urlRSA-SHA256XOSdsku4Tq6zLxmOv0KtTpyG-UKOnlYzEoDXyPl_lkZzcZYm8Jc7ao50swJE1NFIw4uW8PfTTlqnz0pC62MVOVRxOUtiPTTJicux5W__HWf0j_ymUre87VF0Wdt1BoZYR9HeLnx2SGALDc6_ib-eabHA0O3AtSdm0JLq2pprtpA=
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 52c76d0daf..cf21bcd8d2 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -19,3 +19,7 @@ RSpec.configure do |config|
config.include Devise::TestHelpers, type: :controller
config.include Devise::TestHelpers, type: :view
end
+
+def request_fixture(name)
+ File.read(File.join(Rails.root, 'spec', 'fixtures', 'requests', name))
+end