spec/fake_client_spec.rb in nsisam-0.7.3 vs spec/fake_client_spec.rb in nsisam-0.7.4

- old
+ new

@@ -56,44 +56,8 @@ response.key.should == resp.key @nsisam.get(response.key).data.should == "updated" response.checksum.should_not be_nil end - context "can host files" do - it "stored by #store_file" do - response = @nsisam.store_file("file not in base64", 'dumb.txt') - response.key.should_not be_nil - request = Net::HTTP.get_response(URI.parse("http://#{@nsisam.host}:#{@nsisam.port}/file/#{response.key}")) - request.body.should == "file not in base64" - end - - it "stored by #store in a dict with file and filename" do - data = {file: Base64.encode64('a file'), filename: 'dumb.txt'} - response = @nsisam.store(data) - request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key))) - request.body.should == "a file" - end - - it "should update the hosted file when the file is updated through #store" do - data = {file: Base64.encode64('a file'), filename: 'dumb.txt'} - response = @nsisam.store(data) - request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key))) - request.body.should == "a file" - - data = {file: Base64.encode64('another file'), filename: 'dumb.txt'} - response = @nsisam.store(data) - request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key))) - request.body.should == "another file" - end - - it "should update the hosted file when the file is updated through #store_file" do - response = @nsisam.store_file('a file', 'dumb.txt') - request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key))) - request.body.should == "a file" - - response = @nsisam.update_file(response.key, 'another file', 'dumb.txt') - request = Net::HTTP.get_response(URI.parse(@nsisam.download_link_for_file(response.key))) - request.body.should == "another file" - end end end