app
bin
config
db
docs
lib
log
nanobox
public
spec
controllers
activitypub
admin
api
auth
concerns
oauth
settings
well_known
about_controller_spec.rb
account_follow_controller_spec.rb
account_unfollow_controller_spec.rb
accounts_controller_spec.rb
application_controller_spec.rb
authorize_follows_controller_spec.rb
follower_accounts_controller_spec.rb
following_accounts_controller_spec.rb
home_controller_spec.rb
manifests_controller_spec.rb
media_controller_spec.rb
remote_follow_controller_spec.rb
statuses_controller_spec.rb
stream_entries_controller_spec.rb
tags_controller_spec.rb
fabricators
features
fixtures
helpers
lib
mailers
models
policies
presenters
requests
routing
services
support
validators
views
workers
rails_helper.rb
spec_helper.rb
streaming
vendor
.babelrc
.buildpacks
.codeclimate.yml
.dockerignore
.editorconfig
.env.nanobox
.env.production.sample
.env.test
.env.vagrant
.eslintignore
.eslintrc.yml
.foreman
.gitattributes
.gitignore
.haml-lint.yml
.nanoignore
.nvmrc
.postcssrc.yml
.profile
.rspec
.rubocop.yml
.ruby-version
.scss-lint.yml
.slugignore
.travis.yml
.yarnclean
Aptfile
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Capfile
Dockerfile
Gemfile
Gemfile.lock
ISSUE_TEMPLATE.md
LICENSE
Procfile
Procfile.dev
README.md
Rakefile
Vagrantfile
app.json
boxfile.yml
config.ru
docker-compose.yml
docker_entrypoint.sh
jest.config.js
package.json
scalingo.json
yarn.lock
Introduce recent to Follow, as Account and other models have. This change also adds specs for the scope and the dependents.
26 lines
651 B
Ruby
26 lines
651 B
Ruby
require 'rails_helper'
|
|
|
|
describe FollowerAccountsController do
|
|
render_views
|
|
|
|
let(:alice) { Fabricate(:account, username: 'alice') }
|
|
let(:follower0) { Fabricate(:account) }
|
|
let(:follower1) { Fabricate(:account) }
|
|
|
|
describe 'GET #index' do
|
|
it 'assigns follows' do
|
|
follow0 = follower0.follow!(alice)
|
|
follow1 = follower1.follow!(alice)
|
|
|
|
get :index, params: { account_username: alice.username }
|
|
|
|
assigned = assigns(:follows).to_a
|
|
expect(assigned.size).to eq 2
|
|
expect(assigned[0]).to eq follow1
|
|
expect(assigned[1]).to eq follow0
|
|
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
end
|
|
end
|