diff options
author | David Yip <yipdw@member.fsf.org> | 2018-02-23 15:05:00 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-23 15:05:00 -0600 |
commit | f53953d28a24fe65f1ca66d85a1416ba30dcda86 (patch) | |
tree | 4e9e2214629b46ddc98fdce358abc812112f13fa /spec | |
parent | 544543e40a723d9719f5571bd4c3455a6a69fccd (diff) | |
parent | f2f19e1f8a3a048cf0a0041ae54d912acfea7742 (diff) |
Merge pull request #369 from KnzkDev/merge-upstream
Merge with upstream @ e668180044560e28bdc5eef94744c210013efcda
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/api/v1/accounts/relationships_controller_spec.rb | 22 | ||||
-rw-r--r-- | spec/fabricators/backup_fabricator.rb | 3 | ||||
-rw-r--r-- | spec/mailers/previews/user_mailer_preview.rb | 5 | ||||
-rw-r--r-- | spec/models/backup_spec.rb | 5 | ||||
-rw-r--r-- | spec/views/about/show.html.haml_spec.rb | 3 |
5 files changed, 38 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/accounts/relationships_controller_spec.rb b/spec/controllers/api/v1/accounts/relationships_controller_spec.rb index 508415fc8..e0de790c8 100644 --- a/spec/controllers/api/v1/accounts/relationships_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/relationships_controller_spec.rb @@ -66,6 +66,28 @@ describe Api::V1::Accounts::RelationshipsController do expect(json.second[:requested]).to be false expect(json.second[:domain_blocking]).to be false end + + it 'returns JSON with correct data on cached requests too' do + get :index, params: { id: [simon.id] } + + json = body_as_json + + expect(json).to be_a Enumerable + expect(json.first[:following]).to be true + expect(json.first[:showing_reblogs]).to be true + end + + it 'returns JSON with correct data after change too' do + user.account.unfollow!(simon) + + get :index, params: { id: [simon.id] } + + json = body_as_json + + expect(json).to be_a Enumerable + expect(json.first[:following]).to be false + expect(json.first[:showing_reblogs]).to be false + end end end end diff --git a/spec/fabricators/backup_fabricator.rb b/spec/fabricators/backup_fabricator.rb new file mode 100644 index 000000000..99a5bdcda --- /dev/null +++ b/spec/fabricators/backup_fabricator.rb @@ -0,0 +1,3 @@ +Fabricator(:backup) do + user +end diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 8d2a9368d..d9cdb9264 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -34,4 +34,9 @@ class UserMailerPreview < ActionMailer::Preview def welcome UserMailer.welcome(User.first) end + + # Preview this email at http://localhost:3000/rails/mailers/user_mailer/backup_ready + def backup_ready + UserMailer.backup_ready(User.first, Backup.first) + end end diff --git a/spec/models/backup_spec.rb b/spec/models/backup_spec.rb new file mode 100644 index 000000000..fabcdc845 --- /dev/null +++ b/spec/models/backup_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Backup, type: :model do + +end diff --git a/spec/views/about/show.html.haml_spec.rb b/spec/views/about/show.html.haml_spec.rb index ca59fa9e3..be1320ed3 100644 --- a/spec/views/about/show.html.haml_spec.rb +++ b/spec/views/about/show.html.haml_spec.rb @@ -18,6 +18,9 @@ describe 'about/show.html.haml', without_verify_partial_doubles: true do source_url: 'https://github.com/tootsuite/mastodon', open_registrations: false, thumbnail: nil, + hero: nil, + user_count: 0, + status_count: 0, closed_registrations_message: 'yes', commit_hash: commit_hash) |