Skip to content

Instantly share code, notes, and snippets.

function visitorUploadToCloudinary(form) {
var uploadButton = $(form).find('.cloudinary-fileupload'),
uploadLimit = parseInt($(form).data('limit')),
uploadLimitFriendly = (uploadLimit / 1000000) + 'mb';
// prevents form attribute from allowing uploads larger than 300mb.
if ( uploadLimit > 300000000 ) {
uploadLimit = 300000000;
}
class Product < ActiveRecord::Base
# model code here...
# for Sunspot gem. Need to run rake sunspot:solr:start to get this running, and to avoid connection errors.
# each time you change the searchable code on a model, you need to reindex the solr database locally.
searchable do
integer :id
text :name
text :artist
$ rspec ./spec/features/billboard_spec.rb:19
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Run options: include {:locations=>{"./spec/features/billboard_spec.rb"=>[19]}}
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
An error occurred in an after hook
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
require 'spec_helper'
describe 'PhotoGallery', :js => true do
before(:each) do
bootstrap
user_logs_in
@page = create_photo_gallery_page(@website)
visit "#{get_subdomain(@website)}/site_manager/pages"
1) Website creates, updates, and deletes a website
Failure/Error: Unable to find matching line from backtrace
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
POST https://api.cloudinary.com/v1_1/decosites/auto/upload
There is currently no cassette in use. There are a few ways
Failures:
1) MicropostMailer sends a feed update email to administrator
Failure/Error: create_micropost(@website, @user)
Capybara::Ambiguous:
Ambiguous match, found 2 elements matching css "#micropost_group_1"
# ./spec/helper_methods/application_spec_methods.rb:262:in `create_micropost'
# ./spec/mailers/micropost_mailer_spec.rb:14:in `block (2 levels) in <top (required)>'
2) Website visits statistics page successfully
function updateItemSummary() {
var size = $('form.build-product-form input[name=size]:checked').val(),
medium = $('input[name=medium_id]:checked').next().children('span').html(),
option = ($('input[name=medium_option]:checked').val() == 'none') ? 'not applicable' : $('input[name=medium_option]:checked').next().children('span').html(),
style = $('input[name=style]:checked').next().children('span').html(),
frame = $('input[name=frame_id]:checked').next().children('span').html(),
summary = '<b>Size:</b> ' + size +
'<br /><b>Medium:</b> ' + medium +
'<br /><b>Option:</b> ' + option +
'<br /><b>Style:</b> ' + style +
$(".cloudinary-fileupload")
.bind('fileuploadprogress', function(e, data) {
console.log('fileuploadprogress')
})
.off("cloudinarydone").on("cloudinarydone", function (e, data) {
console.log('in it')
})
.fileupload({
// Uncomment the following lines to enable client side image resizing and valiation.
// Make sure cloudinary/processing is included the js file
<div class="section-container auto" data-section>
<section>
<p class="title" data-section-title><a href="#panel2">Categories & Products</a></p>
<div class="content" data-section-content>
<div class="row row-spacing">
<div class="large-12 columns product-list">
<%= form_for([:site_manager, @page, @product], :html => {id: 'new_product'}) do |u| %>
<% error_keys = get_fields_with_errors(flash) %>
describe '#photo_url' do
it {
VCR.use_cassette('cloudinary') do
product.update_attributes(picture: File.open("#{Rails.root}/app/assets/images/image_for_testing.jpg"))
response = product.picture
UserSite::ProductPresenter.new(product, self).photo_url.should == response
end
}
end