Sha256: 8760924e973a7c80c1e7cb1013bee84e91bc66fbececb019c93da49f045cd70d
Contents?: true
Size: 684 Bytes
Versions: 14
Compression:
Stored size: 684 Bytes
Contents
require 'spec_helper' describe MessagesController, type: :controller do describe '#create' do before :each do data = { data: { name: 'John', city: 'Prague', }, scope: {}, } post(:create, javascriptize(data)) end it 'responds consistently to js' do expect(rubize(response)).to eq( success: true, id: '1', scoped_records: all_records(Message), ) end it 'creates the record' do message = Message.find(1) message_attributes = message.attributes.to_options expect(message_attributes.slice(:id, :name)).to eq(id: 1, name: 'John') end end end
Version data entries
14 entries across 14 versions & 1 rubygems