|
|
@@ -21,7 +21,7 @@ describe AgentsController do
|
21
|
21
|
describe "POST handle_details_post" do
|
22
|
22
|
it "passes control to handle_details_post on the agent" do
|
23
|
23
|
sign_in users(:bob)
|
24
|
|
- post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => "bar" }
|
|
24
|
+ post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => "bar" }.to_json
|
25
|
25
|
expect(JSON.parse(response.body)).to eq({ "success" => true })
|
26
|
26
|
expect(agents(:bob_manual_event_agent).events.last.payload).to eq({ 'foo' => "bar" })
|
27
|
27
|
end
|
|
|
@@ -29,7 +29,7 @@ describe AgentsController do
|
29
|
29
|
it "can only be accessed by the Agent's owner" do
|
30
|
30
|
sign_in users(:jane)
|
31
|
31
|
expect {
|
32
|
|
- post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => :bar }
|
|
32
|
+ post :handle_details_post, :id => agents(:bob_manual_event_agent).to_param, :payload => { :foo => :bar }.to_json
|
33
|
33
|
}.to raise_error(ActiveRecord::RecordNotFound)
|
34
|
34
|
end
|
35
|
35
|
end
|