Sha256: 180767f816573e4ce6e67b6ce4ef19ea4c59a6c2dfecc1797bda56a59d85d9e7
Contents?: true
Size: 1.6 KB
Versions: 11
Compression:
Stored size: 1.6 KB
Contents
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe "/opportunities/_new" do include OpportunitiesHelper before do login_and_assign assign(:opportunity, FactoryGirl.build(:opportunity)) @account = FactoryGirl.create(:account) assign(:account, @account) assign(:accounts, [ @account ]) assign(:users, [ current_user ]) assign(:stage, Setting.unroll(:opportunity_stage)) end it "should render [create opportunity] form" do render view.should render_template(:partial => "opportunities/_top_section") view.should render_template(:partial => "entities/_permissions") rendered.should have_tag("form[class=new_opportunity]") end it "should pick default assignee (Myself)" do render rendered.should have_tag("select[id=opportunity_assigned_to]") do |options| options.to_s.should_not include(%Q/selected="selected"/) end end it "should render background info field if settings require so" do Setting.background_info = [ :opportunity ] render rendered.should have_tag("textarea[id=opportunity_background_info]") end it "should not render background info field if settings do not require so" do Setting.background_info = [] render rendered.should_not have_tag("textarea[id=opportunity_background_info]") end end
Version data entries
11 entries across 11 versions & 1 rubygems