File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 33RSpec . describe Preview ::PreviewController , type : :request do
44 describe 'GET /preview' do
55 context 'with the preview environment enabled' do
6- it 'shows a test UI in when SERVE_TEST_UI is true' do
6+ before do
77 allow ( ENV ) . to receive ( :[] ) . with ( 'SERVE_TEST_UI' ) . and_return ( true )
8+ end
9+
10+ it 'shows a test UI in when SERVE_TEST_UI is true' do
811 get preview_path
912 expect ( response ) . to have_http_status ( :ok )
1013 expect ( response . content_type ) . to start_with ( 'text/html' )
1114 end
1215
1316 context 'sets the API URL correctly' do
1417 it 'sets the url for staging API in production' do
15- allow ( ENV ) . to receive ( :[] ) . with ( 'SERVE_TEST_UI' ) . and_return ( true )
1618 allow ( Rails . env ) . to receive ( :production? ) . and_return ( true )
1719 get preview_path
1820 expect ( assigns ( :api_url ) ) . to eq ( 'https://galc-api.ucblib.org' )
1921 end
2022
2123 it 'sets the url for API to be localhost in dev/test' do
22- allow ( ENV ) . to receive ( :[] ) . with ( 'SERVE_TEST_UI' ) . and_return ( true )
2324 allow ( Rails . env ) . to receive ( :production? ) . and_return ( false )
2425 get preview_path
2526 expect ( assigns ( :api_url ) ) . to eq ( 'http://localhost:3000' )
Original file line number Diff line number Diff line change 11require 'rails_helper'
22
3- RSpec . describe 'preview/preview# index' , type : :view do
3+ RSpec . describe 'preview/preview/ index' , type : :view do
44 let ( :endpoint ) { 'https://galc.oski.cat' }
55
66 it 'sets the API endpoint' do
You can’t perform that action at this time.
0 commit comments