mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Check response body instead of assigns in shares controller spec
This commit is contained in:
parent
aa4d8987a0
commit
922373c8f5
1 changed files with 6 additions and 3 deletions
|
@ -10,13 +10,16 @@ describe SharesController do
|
||||||
before { sign_in user }
|
before { sign_in user }
|
||||||
|
|
||||||
describe 'GET #show' do
|
describe 'GET #show' do
|
||||||
subject(:body_classes) { assigns(:body_classes) }
|
|
||||||
|
|
||||||
before { get :show, params: { title: 'test title', text: 'test text', url: 'url1 url2' } }
|
before { get :show, params: { title: 'test title', text: 'test text', url: 'url1 url2' } }
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status 200
|
expect(response).to have_http_status 200
|
||||||
expect(body_classes).to eq 'modal-layout compose-standalone'
|
expect(body_class_values)
|
||||||
|
.to include('modal-layout', 'compose-standalone')
|
||||||
|
end
|
||||||
|
|
||||||
|
def body_class_values
|
||||||
|
Nokogiri::Slop(response.body).css('body').first.classes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue