spec/controllers/js_base_spec.rb in rhoconnect-4.0.1 vs spec/controllers/js_base_spec.rb in rhoconnect-4.0.2
- old
+ new
@@ -27,13 +27,17 @@
Rhoconnect.bootstrap(get_jstestapp_path)
else
Rhoconnect.bootstrap(get_testapp_path)
end
# reload ruby controllers
- Dir[File.join(Rhoconnect.app_directory,'controllers','ruby','*.rb')].each do |controller_file|
+ Dir[File.join(Rhoconnect.app_directory,'controllers','ruby','*.rb')].each do |controller_file|
load controller_file
end
+ # reload ruby models
+ Dir[File.join(Rhoconnect.app_directory,'models','ruby','*.rb')].each do |model_file|
+ load model_file
+ end
end
describe "ApplicationController" do
after(:each) do
Rhoconnect.remove_from_url_map(ApplicationController)
@@ -117,15 +121,15 @@
@product1['_id'] = 'tempobj1'
cud = {'create'=>{'1'=>{'name'=>'hello'}},
:blob_fields => ['txtfile-rhoblob']}.to_json
post "/app/#{Rhoconnect::API_VERSION}/JsSample",
{:cud => cud,'txtfile-rhoblob-1' =>
- Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__),'..','testdata',file1), "application/octet-stream")},
+ Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__),'..','testdata',file1), "application/octet-stream")},
{Rhoconnect::CLIENT_ID_HEADER => @c.id}
last_response.should be_ok
get "/app/#{Rhoconnect::API_VERSION}/JsSample", {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
json = JSON.parse(last_response.body)
- json[5]['links'].should == { "1" => { "l" => "blob_created" } }
+ json[5]['links'].should == { "1" => { "l" => "blob_created" } }
json[5]['delete'].should == { "blob_created" => { "name" => "hello", "txtfile-rhoblob" => "blob_created" } }
end
it "should push_objects to js controller" do
s = Source.load('JsSample', @s_params)
\ No newline at end of file