闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. require 'rails_helper'
  2. RSpec.describe AccountsController, type: :controller do
  3. render_views
  4. let(:alice) { Fabricate(:account, username: 'alice') }
  5. describe 'GET #show' do
  6. before do
  7. status1 = Status.create!(account: alice, text: 'Hello world')
  8. Status.create!(account: alice, text: 'Boop', thread: status1)
  9. status3 = Status.create!(account: alice, text: 'Picture!')
  10. status3.media_attachments.create!(account: alice, file: fixture_file_upload('files/attachment.jpg', 'image/jpeg'))
  11. Status.create!(account: alice, text: 'Mentioning @alice')
  12. end
  13. context 'atom' do
  14. before do
  15. get :show, params: { username: alice.username }, format: 'atom'
  16. end
  17. it 'returns http success with Atom' do
  18. expect(response).to have_http_status(:success)
  19. end
  20. end
  21. context 'html' do
  22. before do
  23. get :show, params: { username: alice.username }
  24. end
  25. it 'returns http success' do
  26. expect(response).to have_http_status(:success)
  27. end
  28. end
  29. end
  30. describe 'GET #followers' do
  31. it 'returns http success' do
  32. get :followers, params: { username: alice.username }
  33. expect(response).to have_http_status(:success)
  34. end
  35. end
  36. describe 'GET #following' do
  37. it 'returns http success' do
  38. get :following, params: { username: alice.username }
  39. expect(response).to have_http_status(:success)
  40. end
  41. end
  42. end