require 'spec_helper' describe '_upload' do let(:album) { stub_model(Album) } let(:album_with_photos) { stub_model(Album, photos: [stub_model(AlbumPhotos)]) } def default_attributes { newAttachments: {}, loadedAttachments: {}, partial: '/image', model: album, relations: 'photos' } end it 'should personalize css classes attributes of newAttachments element' do render 'upload', default_attributes.merge(newAttachments: { class: 'thumbnails' }) rendered.should =~ /