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.

22 lines
726 B

  1. require 'rails_helper'
  2. describe SharesController do
  3. render_views
  4. let(:user) { Fabricate(:user) }
  5. before { sign_in user }
  6. describe 'GTE #show' do
  7. subject(:initial_state_json) { JSON.parse(assigns(:initial_state_json), symbolize_names: true) }
  8. subject(:body_classes) { assigns(:body_classes) }
  9. before { get :show, params: { title: 'test title', text: 'test text', url: 'url1 url2' } }
  10. it 'assigns json' do
  11. expect(response).to have_http_status :ok
  12. expect(initial_state_json[:compose][:text]).to eq 'test title test text url1 url2'
  13. expect(initial_state_json[:meta][:me]).to eq user.account.id.to_s
  14. expect(body_classes).to eq 'modal-layout compose-standalone'
  15. end
  16. end
  17. end