Sha256: 4f00a7ba871ffa6222ab78704e1fe71db6f0500a19aa1b896a0df8b065fe6b41
Contents?: true
Size: 829 Bytes
Versions: 15
Compression:
Stored size: 829 Bytes
Contents
require 'spec_helper' describe 'Picture renderung security', :js => true do let(:picture) { Alchemy::Picture.create(:image_file => File.new(File.expand_path('../../support/image.png', __FILE__))) } # Prevent the signup view from being rendered. before { Alchemy::User.stub!(:count).and_return 1 } context "passing no security token" do it 'should return a bad request (400)' do visit "/pictures/#{picture.id}/show/image.png" page.status_code.should == 400 end end context "passing correct security token" do before do visit "/pictures/#{picture.id}/show/image.png?sh=#{picture.security_token}" end it 'should return image' do page.body.should match(/img/) end it 'should return status ok (200)' do page.status_code.should == 200 end end end
Version data entries
15 entries across 15 versions & 1 rubygems