Sha256: 41a32bcec292dc012331d5e97f6403e3d239725d199d8e1aa998b06a80b7d680
Contents?: true
Size: 1008 Bytes
Versions: 1
Compression:
Stored size: 1008 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe G5Updatable::LocationsController, type: :controller do routes { G5Updatable::Engine.routes } let!(:location) { create(:location) } describe 'GET show' do subject(:show) { safe_get :show, params } context 'valid request' do let(:params) { { urn: location.urn } } let(:json) { JSON.parse(response.body)['location'] } it { is_expected.to be_successful } it 'returns the correct location' do show expect(json['uid']).to eq(location.uid) end end context 'invalid location' do let(:params) { { urn: 'bogus' } } # I don't know whether this behavior was originally intended, # but it's been that way in production since forever, so that's # what we'll support for the sake of backwards compatibility it { is_expected.to be_successful } it 'returns an empty response' do expect(response.body).to be_empty end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
g5_updatable-1.0.2.pre.1 | spec/controllers/locations_controller_spec.rb |