fat_free_crm 0.14.2 → 0.15.0.beta
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.travis.yml +15 -5
- data/{CHANGELOG → CHANGELOG.md} +9 -8
- data/Gemfile +1 -1
- data/Gemfile.lock +78 -70
- data/README.md +8 -10
- data/app/controllers/admin/users_controller.rb +6 -1
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/users_controller.rb +1 -0
- data/app/helpers/tags_helper.rb +1 -1
- data/app/models/users/user.rb +10 -9
- data/config/initializers/paper_trail.rb +1 -0
- data/fat_free_crm.gemspec +4 -4
- data/lib/development_tasks/rspec.rake +2 -6
- data/lib/fat_free_crm/engine.rb +5 -0
- data/lib/fat_free_crm/version.rb +3 -3
- data/spec/factories/field_factories.rb +1 -1
- data/spec/factories/opportunity_factories.rb +1 -1
- data/spec/mailers/subscription_mailer_spec.rb +5 -3
- data/spec/mailers/user_mailer_spec.rb +6 -6
- data/spec/models/users/abilities/user_ability_spec.rb +3 -3
- data/spec/models/users/user_spec.rb +73 -62
- data/spec/support/auth_macros.rb +8 -1
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +1 -1
- data/spec/views/accounts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/accounts/edit.js.haml_spec.rb +2 -2
- data/spec/views/accounts/index.haml_spec.rb +2 -2
- data/spec/views/accounts/index.js.haml_spec.rb +1 -1
- data/spec/views/accounts/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +1 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/destroy.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/edit.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/index.haml_spec.rb +1 -1
- data/spec/views/admin/users/index.js.haml_spec.rb +2 -2
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/suspend.js.haml_spec.rb +1 -1
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -1
- data/spec/views/application/auto_complete.haml_spec.rb +3 -3
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/destroy.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/edit.js.haml_spec.rb +2 -2
- data/spec/views/campaigns/index.haml_spec.rb +1 -1
- data/spec/views/campaigns/index.js.haml_spec.rb +1 -1
- data/spec/views/campaigns/show.haml_spec.rb +4 -4
- data/spec/views/campaigns/update.js.haml_spec.rb +1 -1
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +3 -3
- data/spec/views/contacts/destroy.js.haml_spec.rb +1 -1
- data/spec/views/contacts/edit.js.haml_spec.rb +3 -3
- data/spec/views/contacts/index.haml_spec.rb +1 -1
- data/spec/views/contacts/index.js.html_spec.rb +1 -1
- data/spec/views/contacts/new.js.haml_spec.rb +1 -1
- data/spec/views/contacts/update.js.haml_spec.rb +2 -2
- data/spec/views/home/index.haml_spec.rb +1 -1
- data/spec/views/home/index.js.haml_spec.rb +2 -2
- data/spec/views/home/options.js.haml_spec.rb +2 -2
- data/spec/views/leads/_convert.haml_spec.rb +3 -3
- data/spec/views/leads/_edit.haml_spec.rb +2 -2
- data/spec/views/leads/_new.haml_spec.rb +1 -1
- data/spec/views/leads/_sidebar_show.haml_spec.rb +1 -1
- data/spec/views/leads/convert.js.haml_spec.rb +4 -4
- data/spec/views/leads/create.js.haml_spec.rb +3 -3
- data/spec/views/leads/destroy.js.haml_spec.rb +2 -2
- data/spec/views/leads/edit.js.haml_spec.rb +4 -4
- data/spec/views/leads/index.haml_spec.rb +1 -1
- data/spec/views/leads/index.js.haml_spec.rb +1 -1
- data/spec/views/leads/new.js.haml_spec.rb +1 -1
- data/spec/views/leads/promote.js.haml_spec.rb +7 -7
- data/spec/views/leads/reject.js.haml_spec.rb +2 -2
- data/spec/views/leads/show.haml_spec.rb +2 -2
- data/spec/views/leads/update.js.haml_spec.rb +4 -4
- data/spec/views/opportunities/_edit.haml_spec.rb +5 -5
- data/spec/views/opportunities/_new.haml_spec.rb +1 -1
- data/spec/views/opportunities/create.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/destroy.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/edit.js.haml_spec.rb +3 -3
- data/spec/views/opportunities/index.haml_spec.rb +1 -1
- data/spec/views/opportunities/index.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/new.js.haml_spec.rb +1 -1
- data/spec/views/opportunities/update.js.haml_spec.rb +4 -4
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +4 -4
- data/spec/views/tasks/create.js.haml_spec.rb +5 -5
- data/spec/views/tasks/destroy.js.haml_spec.rb +2 -2
- data/spec/views/tasks/index.haml_spec.rb +4 -4
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +2 -2
- data/spec/views/tasks/update.js.haml_spec.rb +18 -18
- data/spec/views/users/upload_avatar.js.haml_spec.rb +2 -2
- metadata +17 -14
data/spec/support/auth_macros.rb
CHANGED
@@ -25,7 +25,14 @@ alias :require_user :login
|
|
25
25
|
|
26
26
|
#----------------------------------------------------------------------------
|
27
27
|
def login_and_assign(user_stubs = {}, session_stubs = {})
|
28
|
-
|
28
|
+
User.current_user = @current_user = FactoryGirl.build_stubbed(:user, user_stubs)
|
29
|
+
@current_user_session = double(Authentication, {record: current_user}.merge(session_stubs))
|
30
|
+
allow(Authentication).to receive(:find).and_return(@current_user_session)
|
31
|
+
#set_timezone
|
32
|
+
assigns[:current_user] = current_user
|
33
|
+
end
|
34
|
+
def login_and_assign!(user_stubs = {}, session_stubs = {})
|
35
|
+
login
|
29
36
|
assigns[:current_user] = current_user
|
30
37
|
end
|
31
38
|
|
@@ -16,7 +16,7 @@ describe "/accounts/create" do
|
|
16
16
|
# core object Account partial is not embedded.
|
17
17
|
describe "create success" do
|
18
18
|
before do
|
19
|
-
assign(:account, @account = FactoryGirl.
|
19
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account))
|
20
20
|
assign(:accounts, [@account].paginate)
|
21
21
|
assign(:account_category_total, Hash.new(1))
|
22
22
|
render
|
@@ -10,7 +10,7 @@ describe "/accounts/destroy" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
assign(:account, @account = FactoryGirl.
|
13
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account))
|
14
14
|
assign(:accounts, [@account].paginate)
|
15
15
|
assign(:account_category_total, Hash.new(1))
|
16
16
|
render
|
@@ -10,7 +10,7 @@ describe "/accounts/edit" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
assign(:account, @account = FactoryGirl.
|
13
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account, user: current_user))
|
14
14
|
assign(:users, [current_user])
|
15
15
|
end
|
16
16
|
|
@@ -31,7 +31,7 @@ describe "/accounts/edit" do
|
|
31
31
|
|
32
32
|
it "edit: should hide previously open [Edit Account] for and replace it with account partial" do
|
33
33
|
params[:cancel] = nil
|
34
|
-
assign(:previous, previous = FactoryGirl.
|
34
|
+
assign(:previous, previous = FactoryGirl.build_stubbed(:account, user: current_user))
|
35
35
|
|
36
36
|
render
|
37
37
|
expect(rendered).to include("account_#{previous.id}")
|
@@ -17,13 +17,13 @@ describe "/accounts/index" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should render account name" do
|
20
|
-
assign(:accounts, [FactoryGirl.
|
20
|
+
assign(:accounts, [FactoryGirl.build_stubbed(:account, name: 'New Media Inc'), FactoryGirl.build_stubbed(:account)].paginate)
|
21
21
|
render
|
22
22
|
expect(rendered).to have_tag('a', text: "New Media Inc")
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should render list of accounts if list of accounts is not empty" do
|
26
|
-
assign(:accounts, [FactoryGirl.
|
26
|
+
assign(:accounts, [FactoryGirl.build_stubbed(:account), FactoryGirl.build_stubbed(:account)].paginate)
|
27
27
|
|
28
28
|
render
|
29
29
|
expect(view).to render_template(partial: "_account")
|
@@ -13,7 +13,7 @@ describe "/accounts/index" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should render [account] template with @accounts collection if there are accounts" do
|
16
|
-
assign(:accounts, [FactoryGirl.
|
16
|
+
assign(:accounts, [FactoryGirl.build_stubbed(:account, id: 42)].paginate)
|
17
17
|
|
18
18
|
render template: 'accounts/index', formats: [:js]
|
19
19
|
|
@@ -11,7 +11,7 @@ describe "/accounts/update" do
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
13
|
|
14
|
-
assign(:account, @account = FactoryGirl.
|
14
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account, user: current_user))
|
15
15
|
assign(:users, [current_user])
|
16
16
|
assign(:account_category_total, Hash.new(1))
|
17
17
|
end
|
@@ -11,7 +11,7 @@ describe "admin/field_groups/create" do
|
|
11
11
|
assign(:field_group, field_group)
|
12
12
|
end
|
13
13
|
|
14
|
-
let(:field_group) { FactoryGirl.
|
14
|
+
let(:field_group) { FactoryGirl.build_stubbed(:field_group, label: 'test') }
|
15
15
|
|
16
16
|
it "renders javascript" do
|
17
17
|
render
|
@@ -11,7 +11,7 @@ describe "admin/field_groups/edit" do
|
|
11
11
|
assign(:field_group, field_group)
|
12
12
|
end
|
13
13
|
|
14
|
-
let(:field_group) { FactoryGirl.
|
14
|
+
let(:field_group) { FactoryGirl.build_stubbed(:field_group, label: 'test') }
|
15
15
|
|
16
16
|
it "renders javascript" do
|
17
17
|
render
|
@@ -11,7 +11,7 @@ describe "admin/field_groups/new" do
|
|
11
11
|
assign(:field_group, field_group)
|
12
12
|
end
|
13
13
|
|
14
|
-
let(:field_group) { FactoryGirl.
|
14
|
+
let(:field_group) { FactoryGirl.build_stubbed(:field_group, label: 'test') }
|
15
15
|
|
16
16
|
it "renders javascript" do
|
17
17
|
render
|
@@ -11,7 +11,7 @@ describe "admin/field_groups/update" do
|
|
11
11
|
assign(:field_group, field_group)
|
12
12
|
end
|
13
13
|
|
14
|
-
let(:field_group) { FactoryGirl.
|
14
|
+
let(:field_group) { FactoryGirl.build_stubbed(:field_group, label: 'test') }
|
15
15
|
|
16
16
|
it "renders javascript" do
|
17
17
|
render
|
@@ -8,7 +8,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
8
8
|
describe "admin/users/edit" do
|
9
9
|
before do
|
10
10
|
login_and_assign(admin: true)
|
11
|
-
assign(:user, @user = FactoryGirl.
|
11
|
+
assign(:user, @user = FactoryGirl.build_stubbed(:user))
|
12
12
|
end
|
13
13
|
|
14
14
|
it "cancel replaces [Edit User] form with user partial" do
|
@@ -19,7 +19,7 @@ describe "admin/users/edit" do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "edit hides previously open [Edit User] and replaces it with user partial" do
|
22
|
-
assign(:previous, previous = FactoryGirl.
|
22
|
+
assign(:previous, previous = FactoryGirl.build_stubbed(:user))
|
23
23
|
render
|
24
24
|
|
25
25
|
expect(rendered).to include("user_#{previous.id}")
|
@@ -11,7 +11,7 @@ describe "/admin/users/index" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "renders a list of users" do
|
14
|
-
assign(:users, [FactoryGirl.
|
14
|
+
assign(:users, [FactoryGirl.build_stubbed(:user)].paginate)
|
15
15
|
|
16
16
|
render
|
17
17
|
expect(view).to render_template(partial: "_user")
|
@@ -11,8 +11,8 @@ describe "admin/users/index" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "renders [admin/user] template with @users collection" do
|
14
|
-
amy = FactoryGirl.
|
15
|
-
bob = FactoryGirl.
|
14
|
+
amy = FactoryGirl.build_stubbed(:user)
|
15
|
+
bob = FactoryGirl.build_stubbed(:user)
|
16
16
|
assign(:users, [amy, bob].paginate)
|
17
17
|
|
18
18
|
render template: 'admin/users/index', formats: [:js]
|
@@ -8,7 +8,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
8
8
|
describe "admin/users/reactivate" do
|
9
9
|
before do
|
10
10
|
login_and_assign(admin: true)
|
11
|
-
assign(:user, @user = FactoryGirl.
|
11
|
+
assign(:user, @user = FactoryGirl.build_stubbed(:user, suspended_at: Time.now.yesterday))
|
12
12
|
end
|
13
13
|
|
14
14
|
it "reloads the requested user partial" do
|
@@ -8,7 +8,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
8
8
|
describe "admin/users/suspend" do
|
9
9
|
before do
|
10
10
|
login_and_assign(admin: true)
|
11
|
-
assign(:user, @user = FactoryGirl.
|
11
|
+
assign(:user, @user = FactoryGirl.build_stubbed(:user, suspended_at: nil))
|
12
12
|
end
|
13
13
|
|
14
14
|
it "reloads the requested user partial" do
|
@@ -15,11 +15,11 @@ describe "/application/_auto_complete" do
|
|
15
15
|
[:account, :campaign, :contact, :lead, :opportunity].each do |model|
|
16
16
|
it "should render autocomplete list if #{model} matches found" do
|
17
17
|
@auto_complete = if model == :lead
|
18
|
-
FactoryGirl.
|
18
|
+
FactoryGirl.build_stubbed(:lead, first_name: "Billy", last_name: "Bones", company: "Hello, World!")
|
19
19
|
elsif model == :contact
|
20
|
-
FactoryGirl.
|
20
|
+
FactoryGirl.build_stubbed(:contact, first_name: "Billy", last_name: "Bones")
|
21
21
|
else
|
22
|
-
FactoryGirl.
|
22
|
+
FactoryGirl.build_stubbed(model, name: "Hello, World!")
|
23
23
|
end
|
24
24
|
assign(:auto_complete, [@auto_complete])
|
25
25
|
|
@@ -12,7 +12,7 @@ describe "/campaigns/create" do
|
|
12
12
|
|
13
13
|
describe "create success" do
|
14
14
|
before do
|
15
|
-
assign(:campaign, @campaign = FactoryGirl.
|
15
|
+
assign(:campaign, @campaign = FactoryGirl.build_stubbed(:campaign))
|
16
16
|
assign(:campaigns, [@campaign].paginate)
|
17
17
|
assign(:campaign_status_total, Hash.new(1))
|
18
18
|
render
|
@@ -37,7 +37,7 @@ describe "/campaigns/create" do
|
|
37
37
|
describe "create failure" do
|
38
38
|
it "should re-render [create] template in :create_campaign div" do
|
39
39
|
assign(:campaign, FactoryGirl.build(:campaign, name: nil)) # make it invalid
|
40
|
-
assign(:users, [FactoryGirl.
|
40
|
+
assign(:users, [FactoryGirl.build_stubbed(:user)])
|
41
41
|
|
42
42
|
render
|
43
43
|
|
@@ -8,7 +8,7 @@ require 'spec_helper'
|
|
8
8
|
describe "/campaigns/destroy" do
|
9
9
|
before do
|
10
10
|
login_and_assign
|
11
|
-
assign(:campaign, @campaign = FactoryGirl.
|
11
|
+
assign(:campaign, @campaign = FactoryGirl.build_stubbed(:campaign, user: current_user))
|
12
12
|
assign(:campaigns, [@campaign].paginate)
|
13
13
|
assign(:campaign_status_total, Hash.new(1))
|
14
14
|
render
|
@@ -10,7 +10,7 @@ describe "/campaigns/edit" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
assign(:campaign, @campaign = FactoryGirl.
|
13
|
+
assign(:campaign, @campaign = FactoryGirl.build_stubbed(:campaign, user: current_user))
|
14
14
|
assign(:users, [current_user])
|
15
15
|
end
|
16
16
|
|
@@ -31,7 +31,7 @@ describe "/campaigns/edit" do
|
|
31
31
|
|
32
32
|
it "edit: should hide previously open [Edit Campaign] for and replace it with campaign partial" do
|
33
33
|
params[:cancel] = nil
|
34
|
-
assign(:previous, previous = FactoryGirl.
|
34
|
+
assign(:previous, previous = FactoryGirl.build_stubbed(:campaign, user: current_user))
|
35
35
|
|
36
36
|
render
|
37
37
|
expect(rendered).to include("$('#campaign_#{previous.id}').replaceWith('<li class=\\'campaign highlight\\' id=\\'campaign_#{previous.id}\\'")
|
@@ -17,7 +17,7 @@ describe "/campaigns/index" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should render list of accounts if list of campaigns is not empty" do
|
20
|
-
assign(:campaigns, [FactoryGirl.
|
20
|
+
assign(:campaigns, [FactoryGirl.build_stubbed(:campaign)].paginate)
|
21
21
|
|
22
22
|
render
|
23
23
|
expect(view).to render_template(partial: "_campaign")
|
@@ -13,7 +13,7 @@ describe "/campaigns/index" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should render [campaign] template with @campaigns collection if there are campaigns" do
|
16
|
-
assign(:campaigns, [FactoryGirl.
|
16
|
+
assign(:campaigns, [FactoryGirl.build_stubbed(:campaign, id: 42)].paginate)
|
17
17
|
|
18
18
|
render template: 'campaigns/index', formats: [:js]
|
19
19
|
|
@@ -10,13 +10,13 @@ describe "/campaigns/show" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
@campaign = FactoryGirl.
|
14
|
-
leads: [FactoryGirl.
|
15
|
-
opportunities: [FactoryGirl.
|
13
|
+
@campaign = FactoryGirl.build_stubbed(:campaign, id: 42,
|
14
|
+
leads: [FactoryGirl.build_stubbed(:lead)],
|
15
|
+
opportunities: [FactoryGirl.build_stubbed(:opportunity)])
|
16
16
|
assign(:campaign, @campaign)
|
17
17
|
assign(:users, [current_user])
|
18
18
|
assign(:comment, Comment.new)
|
19
|
-
assign(:timeline, [FactoryGirl.
|
19
|
+
assign(:timeline, [FactoryGirl.build_stubbed(:comment, commentable: @campaign)])
|
20
20
|
allow(view).to receive(:params) { { id: 123 } }
|
21
21
|
end
|
22
22
|
|
@@ -8,7 +8,7 @@ require 'spec_helper'
|
|
8
8
|
describe "/campaigns/update" do
|
9
9
|
before do
|
10
10
|
login_and_assign
|
11
|
-
assign(:campaign, @campaign = FactoryGirl.
|
11
|
+
assign(:campaign, @campaign = FactoryGirl.build_stubbed(:campaign, user: current_user))
|
12
12
|
assign(:users, [current_user])
|
13
13
|
assign(:status, Setting.campaign_status)
|
14
14
|
assign(:campaign_status_total, Hash.new(1))
|
@@ -14,7 +14,7 @@ describe "/contacts/create" do
|
|
14
14
|
|
15
15
|
describe "create success" do
|
16
16
|
before do
|
17
|
-
assign(:contact, @contact = FactoryGirl.
|
17
|
+
assign(:contact, @contact = FactoryGirl.build_stubbed(:contact))
|
18
18
|
assign(:contacts, [@contact].paginate)
|
19
19
|
end
|
20
20
|
|
@@ -50,8 +50,8 @@ describe "/contacts/create" do
|
|
50
50
|
describe "create failure" do
|
51
51
|
it "create (failure): should re-render [create] template in :create_contact div" do
|
52
52
|
assign(:contact, FactoryGirl.build(:contact, first_name: nil)) # make it invalid
|
53
|
-
@account = FactoryGirl.
|
54
|
-
assign(:users, [FactoryGirl.
|
53
|
+
@account = FactoryGirl.build_stubbed(:account)
|
54
|
+
assign(:users, [FactoryGirl.build_stubbed(:user)])
|
55
55
|
assign(:account, @account)
|
56
56
|
assign(:accounts, [@account])
|
57
57
|
|
@@ -10,9 +10,9 @@ describe "/contacts/edit" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
assign(:contact, @contact = FactoryGirl.
|
13
|
+
assign(:contact, @contact = FactoryGirl.build_stubbed(:contact, user: current_user))
|
14
14
|
assign(:users, [current_user])
|
15
|
-
assign(:account, @account = FactoryGirl.
|
15
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account))
|
16
16
|
assign(:accounts, [@account])
|
17
17
|
end
|
18
18
|
|
@@ -33,7 +33,7 @@ describe "/contacts/edit" do
|
|
33
33
|
|
34
34
|
it "edit: should hide previously open [Edit Contact] for and replace it with contact partial" do
|
35
35
|
params[:cancel] = nil
|
36
|
-
assign(:previous, previous = FactoryGirl.
|
36
|
+
assign(:previous, previous = FactoryGirl.build_stubbed(:contact, user: current_user))
|
37
37
|
|
38
38
|
render
|
39
39
|
expect(rendered).to include("$('#contact_#{previous.id}').replaceWith")
|
@@ -17,7 +17,7 @@ describe "/contacts/index" do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should render a list of contacts if it's not empty" do
|
20
|
-
assign(:contacts, [FactoryGirl.
|
20
|
+
assign(:contacts, [FactoryGirl.build_stubbed(:contact)].paginate)
|
21
21
|
|
22
22
|
render
|
23
23
|
expect(view).to render_template(partial: "_contact")
|
@@ -13,7 +13,7 @@ describe "/contacts/index" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should render [contact] template with @contacts collection if there are contacts" do
|
16
|
-
assign(:contacts, [FactoryGirl.
|
16
|
+
assign(:contacts, [FactoryGirl.build_stubbed(:contact, id: 42)].paginate)
|
17
17
|
|
18
18
|
render template: 'contacts/index', formats: [:js]
|
19
19
|
|
@@ -10,7 +10,7 @@ describe "/contacts/new" do
|
|
10
10
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
|
-
@account = FactoryGirl.
|
13
|
+
@account = FactoryGirl.build_stubbed(:account)
|
14
14
|
assign(:contact, Contact.new(user: current_user))
|
15
15
|
assign(:users, [current_user])
|
16
16
|
assign(:account, @account)
|
@@ -11,9 +11,9 @@ describe "/contacts/update" do
|
|
11
11
|
before do
|
12
12
|
login_and_assign
|
13
13
|
|
14
|
-
assign(:contact, @contact = FactoryGirl.
|
14
|
+
assign(:contact, @contact = FactoryGirl.build_stubbed(:contact, user: current_user))
|
15
15
|
assign(:users, [current_user])
|
16
|
-
assign(:account, @account = FactoryGirl.
|
16
|
+
assign(:account, @account = FactoryGirl.build_stubbed(:account))
|
17
17
|
assign(:accounts, [@account])
|
18
18
|
end
|
19
19
|
|