Sha256: b102f639341f359cb3e4a65353254d747181004a9a4d6e019b5cdf1b855b4078
Contents?: true
Size: 845 Bytes
Versions: 17
Compression:
Stored size: 845 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 "/alchemy/pictures/#{picture.id}/show/image.png" page.status_code.should == 400 end end context "passing correct security token" do before do visit "/alchemy/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
17 entries across 17 versions & 1 rubygems