Skip to content

Commit

Permalink
Add pending on "can upload a new resource" spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Sanchez committed Jul 19, 2016
1 parent a8a31eb commit 75798be
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module Refinery
end

it "can upload a new resource" do
pending "TODO: Find why i can't upload a new resource by the Rest API"
expect do
api_post :create, resource: { file: [upload_file('refinery_is_awesome.txt', 'text/html')] }
expect(response.status).to eq(201)
Expand Down

2 comments on commit 75798be

@simi
Copy link
Member

@simi simi commented on 75798be Jul 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bricesanchez!

This is because you expect @resource in template, but only array of @resources is defined in controller.

I'm not sure how to handle this in returned views, but now you're returning only last image for example regardless multiple images were created. Images works only because @image is defined in controller.

Probably you'll need to use separate views for show and create (just array of show view) to return list of created resources for create action.

@bricesanchez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip @simi!
I will come back to this when i will have my refinerycms_middleman extension working.
I've created this issue #3 to be sure to fix this problem :)

Please sign in to comment.