Sha256: 0e0768835f528fa98c87164093a044a83ffba951814343b1b09a035fdad7dd36
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' describe G5Updatable::SyncsController, type: :controller do routes { G5Updatable::Engine.routes } describe 'GET index' do let(:client){ create(:client) } let!(:location) { create(:location, client: client) } let!(:location2) { create(:location, client: client, urn: 'dif-urn', uid: 'http://hub.com/clients/dd/locations/dif-urn') } let!(:location3) { create(:location, client: client, urn: 'dif-urn2', uid: 'http://hub.com/clients/dd/locations/dif-urn2') } let(:expected_result) { location2.updated_at.in_time_zone.strftime("%I:%M%P on %B %e, %Y") } let(:params) { {urn: client.urn } } subject do get :index, params JSON.parse response.body end its(['updated_at']){ is_expected.to eq(expected_result) } describe "no client" do let(:params) { {urn: "xxx" } } it "raises" do # This error will cause rails to return a 404 in production expect{ subject }.to raise_error(ActiveRecord::RecordNotFound) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
g5_updatable-0.20.3.pre.1 | spec/controllers/syncs_controller_spec.rb |