@ -10,6 +10,13 @@ RSpec.describe AccountsController, type: :controller do
let! ( :status2 ) { Status . create! ( account : alice , text : 'Boop' , thread : status1 ) }
let! ( :status2 ) { Status . create! ( account : alice , text : 'Boop' , thread : status1 ) }
let! ( :status3 ) { Status . create! ( account : alice , text : 'Picture!' ) }
let! ( :status3 ) { Status . create! ( account : alice , text : 'Picture!' ) }
let! ( :status4 ) { Status . create! ( account : alice , text : 'Mentioning @alice' ) }
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
before do
status3 . media_attachments . create! ( account : alice , file : fixture_file_upload ( 'files/attachment.jpg' , 'image/jpeg' ) )
status3 . media_attachments . create! ( account : alice , file : fixture_file_upload ( 'files/attachment.jpg' , 'image/jpeg' ) )
@ -70,6 +77,14 @@ RSpec.describe AccountsController, type: :controller do
expect ( statuses [ 1 ] ) . to eq status2
expect ( statuses [ 1 ] ) . to eq status2
end
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
it 'returns http success' do
expect ( response ) . to have_http_status ( :success )
expect ( response ) . to have_http_status ( :success )
end
end