Skip to content

Instantly share code, notes, and snippets.

@oivoodoo
Created October 17, 2011 13:49
Show Gist options
  • Save oivoodoo/1292637 to your computer and use it in GitHub Desktop.
Save oivoodoo/1292637 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe AnalyticsController do
#integrate_views
before do
stub_isar_controllers
@account = Account.first
@user = User.first
operational_log = OperationalLog.create!(:title => "Test Log", :account_id => @account.id, :created_by => @user.id)
@template = @account.templates.create!(:label => 'Default', :templatable => operational_log)
@account.update_attribute(:default_log_template => @template.id)
end
describe "#show" do
def do_get
@request.env["HTTP_ACCEPT"] = "application/pdf"
get :show, { :id => @template.id }
end
it "should render pdf" do
do_get
response.content_type.should == "application/pdf"
response.should be_success
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment