@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/campaigns/new.js.rjs" do
describe "/campaigns/new" do
include CampaignsHelper

before do
@@ -23,7 +23,7 @@
end

describe "new campaign" do
it "should render [new.html.haml] template into :create_campaign div" do
it "should render [new] template into :create_campaign div" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/campaigns/options.rjs" do
describe "/campaigns/options" do
include CampaignsHelper

before do
@@ -23,7 +23,7 @@
end

describe "campaign options" do
it "should render [options.html.haml] template into :options div and show it" do
it "should render [options] template into :options div and show it" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/campaigns/show.html.haml" do
describe "/campaigns/show" do
include CampaignsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/campaigns/update.js.rjs" do
describe "/campaigns/update" do
before do
login_and_assign
assign(:campaign, @campaign = Factory(:campaign, :user => @current_user))
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/comments/new.js.rjs" do
describe "/comments/new" do
include CommentsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/shared/auto_complete.html.haml" do
describe "/shared/auto_complete" do
include AccountsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/_edit.html.haml" do
describe "/contacts/_edit" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/_new.html.haml" do
describe "/contacts/_new" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/create.js.rjs" do
describe "/contacts/create" do
include ContactsHelper

before do
@@ -48,7 +48,7 @@
end

describe "create failure" do
it "create (failure): should re-render [create.html.haml] template in :create_contact div" do
it "create (failure): should re-render [create] template in :create_contact div" do
assign(:contact, Factory.build(:contact, :first_name => nil)) # make it invalid
@current_user = Factory(:user)
@account = Factory(:account)
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/destroy.js.rjs" do
describe "/contacts/destroy" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/edit.js.rjs" do
describe "/contacts/edit" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/index.html.haml" do
describe "/contacts/index" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/index.js.rjs" do
describe "/contacts/index" do
include ContactsHelper

before do
@@ -10,7 +10,8 @@
it "should render [contact] template with @contacts collection if there are contacts" do
assign(:contacts, [ Factory(:contact, :id => 42) ].paginate)

render
render :template => 'contacts/index', :formats => [:js]

rendered.should have_rjs("contacts") do |rjs|
with_tag("li[id=contact_#{42}]")
end
@@ -20,7 +21,8 @@
it "should render [empty] template if @contacts collection if there are no contacts" do
assign(:contacts, [].paginate)

render
render :template => 'contacts/index', :formats => [:js]

rendered.should have_rjs("contacts") do |rjs|
with_tag("div[id=empty]")
end
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/new.js.rjs" do
describe "/contacts/new" do
include ContactsHelper

before do
@@ -26,7 +26,7 @@
end

describe "new contact" do
it "should render [new.html.haml] template into :create_contact div" do
it "should render [new] template into :create_contact div" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/options.js.rjs" do
describe "/contacts/options" do
include ContactsHelper

before do
@@ -24,7 +24,7 @@
end

describe "contact options" do
it "should render [options.html.haml] template into :options div and show it" do
it "should render [options] template into :options div and show it" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/show.html.haml" do
describe "/contacts/show" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/contacts/update.js.rjs" do
describe "/contacts/update" do
include ContactsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/home/index.html.haml" do
describe "/home/index" do
include HomeHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/home/index.js.rjs" do
describe "/home/index" do
include HomeHelper

before do
@@ -10,7 +10,8 @@
it "should render [activity] template with @activities collection" do
assign(:activities, [ Factory(:activity, :id => 42, :action => "updated", :subject => Factory(:account)) ])

render
render :template => 'home/index', :formats => [:js]

rendered.should have_rjs("activities") do |rjs|
with_tag("li[id=activity_42]")
end
@@ -19,7 +20,8 @@
it "should render a message if there're no activities" do
assign(:activities, [])

render
render :template => 'home/index', :formats => [:js]

rendered.should have_rjs("activities")
rendered.should include("No activity records found.")
end
@@ -1,11 +1,11 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/home/options.rjs" do
describe "/home/options" do
before do
login_and_assign
end

it "should render [options.html.haml] template into :options div and show it" do
it "should render [options] template into :options div and show it" do
params[:cancel] = nil

assign(:asset, "all")
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/_convert.html.haml" do
describe "/leads/_convert" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/_edit.html.haml" do
describe "/leads/_edit" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/_new.html.haml" do
describe "/leads/_new" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/_sidebar_show.html.haml" do
describe "/leads/_sidebar_show" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/convert.js.rjs" do
describe "/leads/convert" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/create.js.rjs" do
describe "/leads/create" do
before do
controller.controller_path = 'leads'
login_and_assign
@@ -54,7 +54,7 @@
end

describe "create failure" do
it "should re-render [create.html.haml] template in :create_lead div" do
it "should re-render [create] template in :create_lead div" do
assign(:lead, Factory.build(:lead, :first_name => nil)) # make it invalid
assign(:users, [ Factory(:user) ])

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/destroy.js.rjs" do
describe "/leads/destroy" do
before do
login_and_assign
assign(:lead, @lead = Factory(:lead))
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/edit.js.rjs" do
describe "/leads/edit" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/index.html.haml" do
describe "/leads/index" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/index.js.rjs" do
describe "/leads/index" do
include LeadsHelper

before do
@@ -10,7 +10,8 @@
it "should render [lead] template with @leads collection if there are leads" do
assign(:leads, [ Factory(:lead, :id => 42) ].paginate(:page => 1, :per_page => 20))

render
render :template => 'leads/index', :formats => [:js]

rendered.should have_rjs("leads") do |rjs|
with_tag("li[id=lead_#{42}]")
end
@@ -20,7 +21,8 @@
it "should render [empty] template if @leads collection if there are no leads" do
assign(:leads, [].paginate(:page => 1, :per_page => 20))

render
render :template => 'leads/index', :formats => [:js]

rendered.should have_rjs("leads") do |rjs|
with_tag("div[id=empty]")
end
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/new.js.rjs" do
describe "/leads/new" do
include LeadsHelper

before do
@@ -26,7 +26,7 @@
end

describe "new lead" do
it "should render [new.html.haml] template into :create_lead div" do
it "should render [new] template into :create_lead div" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/options.rjs" do
describe "/leads/options" do
include LeadsHelper

before do
@@ -24,7 +24,7 @@
end

describe "lead options" do
it "should render [options.html.haml] template into :options div and show it" do
it "should render [options] template into :options div and show it" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/promote.js.rjs" do
describe "/leads/promote" do
before do
login_and_assign
assign(:users, [ @current_user ])
@@ -79,7 +79,7 @@
it "should update campaign sidebar" do
render

assert_select_rjs("sidebar") do |rjs|
rendered.should have_rjs("sidebar") do |rjs|
with_tag("div[class=panel][id=summary]")
with_tag("div[class=panel][id=recently]")
end
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/reject.js.rjs" do
describe "/leads/reject" do
before do
login_and_assign
assign(:lead, @lead = Factory(:lead, :status => "new"))
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/show.html.haml" do
describe "/leads/show" do
include LeadsHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/leads/update.js.rjs" do
describe "/leads/update" do
before do
login_and_assign
assign(:lead, @lead = Factory(:lead, :user => @current_user, :assignee => Factory(:user)))
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/_edit.html.haml" do
describe "/opportunities/_edit" do
include OpportunitiesHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/_new.html.haml" do
describe "/opportunities/_new" do
include OpportunitiesHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/create.js.rjs" do
describe "/opportunities/create" do
before do
login_and_assign
assign(:stage, Setting.unroll(:opportunity_stage))
@@ -72,7 +72,7 @@
end

describe "create failure" do
it "should re-render [create.html.haml] template in :create_opportunity div" do
it "should re-render [create] template in :create_opportunity div" do
assign(:opportunity, Factory.build(:opportunity, :name => nil)) # make it invalid
@account = Factory(:account)
assign(:users, [ Factory(:user) ])
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/destroy.js.rjs" do
describe "/opportunities/destroy" do
before do
login_and_assign
assign(:opportunity, @opportunity = Factory(:opportunity))
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/edit.js.rjs" do
describe "/opportunities/edit" do
include OpportunitiesHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/index.html.haml" do
describe "/opportunities/index" do
include OpportunitiesHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/index.js.rjs" do
describe "/opportunities/index" do
include OpportunitiesHelper

before do
@@ -11,7 +11,8 @@
it "should render [opportunity] template with @opportunities collection if there are opportunities" do
assign(:opportunities, [ Factory(:opportunity, :id => 42) ].paginate)

render
render :template => 'opportunities/index', :formats => [:js]

rendered.should have_rjs("opportunities") do |rjs|
with_tag("li[id=opportunity_#{42}]")
end
@@ -21,7 +22,8 @@
it "should render [empty] template if @opportunities collection if there are no opportunities" do
assign(:opportunities, [].paginate)

render
render :template => 'opportunities/index', :formats => [:js]

rendered.should have_rjs("opportunities") do |rjs|
with_tag("div[id=empty]")
end
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/new.js.rjs" do
describe "/opportunities/new" do
include OpportunitiesHelper

before do
@@ -27,7 +27,7 @@
end

describe "new opportunity" do
it "should render [new.html.haml] template into :create_opportunity div" do
it "should render [new] template into :create_opportunity div" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/options.rjs" do
describe "/opportunities/options" do
include OpportunitiesHelper

before do
@@ -24,7 +24,7 @@
end

describe "opportunity options" do
it "should render [options.html.haml] template into :options div and show it" do
it "should render [options] template into :options div and show it" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/show.html.haml" do
describe "/opportunities/show" do
include OpportunitiesHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/opportunities/update.js.rjs" do
describe "/opportunities/update" do
before do
login_and_assign

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/_edit.html.haml" do
describe "/tasks/_edit" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/complete.js.rjs" do
describe "/tasks/complete" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/create.js.rjs" do
describe "/tasks/create" do
include TasksHelper

before do
@@ -112,7 +112,7 @@
end
end

it "create failure: should re-render [create.html.haml] template in :create_task div" do
it "create failure: should re-render [create] template in :create_task div" do
assign(:task, Factory.build(:task, :name => nil)) # make it invalid
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/destroy.js.rjs" do
describe "/tasks/destroy" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/edit.js.rjs" do
describe "/tasks/edit" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/index.html.haml" do
describe "/tasks/index" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/new.js.rjs" do
describe "/tasks/new" do
include TasksHelper

before do
@@ -21,7 +21,7 @@
before(:all) { @task_with_time = Setting.task_calendar_with_time }
after(:all) { Setting.task_calendar_with_time = @task_with_time }

it "create: should render [new.html.haml] template into :create_task div" do
it "create: should render [new] template into :create_task div" do
params[:cancel] = nil
render

@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/tasks/update.js.rjs" do
describe "/tasks/update" do
include TasksHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/avatar.js.rjs" do
describe "/users/avatar" do
include UsersHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/change_password.js.rjs" do
describe "/users/change_password" do
include UsersHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/edit.js.rjs" do
describe "/users/edit" do
include UsersHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/password.js.rjs" do
describe "/users/password" do
include UsersHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/update.js.rjs" do
describe "/users/update" do
include UsersHelper

before do
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/users/upload_avatar.js.rjs" do
describe "/users/upload_avatar" do
include UsersHelper

before do