tasks/thor/templates/generator/example_app/spec/v1/controllers/users_spec.rb in praxis-2.0.pre.10 vs tasks/thor/templates/generator/example_app/spec/v1/controllers/users_spec.rb in praxis-2.0.pre.11
- old
+ new
@@ -11,11 +11,11 @@
let(:json_payload) { JSON.dump(payload) }
let(:parsed_body) { JSON.parse(response.body, symbolize_names: true) }
context 'index' do
let(:filters_q) { '' }
- let(:fields_q) { 'uid,uuid' }
+ let(:fields_q) { 'id' }
let(:query_string) do
"filters=#{CGI.escape(filters_q)}&fields=#{CGI.escape(fields_q)}"
end
subject { get "/users?#{query_string}" }
@@ -28,10 +28,10 @@
context 'using filters' do
let(:filters_q) { 'first_name=Peter' }
it 'returns only peter' do
expect(parsed_body.size).to eq(1)
# Peter has id 11 from our seeds
- expect(parsed_body.map{|u| u[:uid]}).to eq(['11'])
+ expect(parsed_body.map{|u| u[:id]}).to eq([11])
end
end
end
end
\ No newline at end of file