Skip to content

Commit

Permalink
Prefer build over create if DB not needed
Browse files Browse the repository at this point in the history
Finished in 22.86 seconds (files took 8.07 seconds to load)
vs
Finished in 16.17 seconds (files took 8.75 seconds to load)
  • Loading branch information
CloCkWeRX committed Dec 1, 2016
1 parent f5efeb8 commit 18efe08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/models/users/abilities/user_ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ def all_actions

describe "User abilities" do
subject(:ability) { Ability.new(user) }
let(:subject_user) { create :user }
let(:subject_user) { build :user }

context "when site manager, I" do
let(:user) { create :user, admin: true }
let(:user) { build :user, admin: true }
all_actions.each do |do_action|
it { is_expected.to be_able_to(do_action, subject_user) }
end
end

context "when myself, I" do
let(:user) { create :user }
let(:user) { build :user }
let(:subject_user) { user }
all_actions.each do |do_action|
it { is_expected.to be_able_to(do_action, subject_user) }
Expand Down

0 comments on commit 18efe08

Please sign in to comment.