Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/remockable/active_record/have_default_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
end

def method_missing(method, *args, &block)
unsupported_query_methods = %w(
create_with
eager_load
includes
lock
preload
readonly
)

query_methods = %w(
from
group
Expand Down
6 changes: 3 additions & 3 deletions lib/remockable/active_record/have_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def column_names
unique = options[:unique]
indexes = ActiveRecord::Base.connection.indexes(subject.class.table_name)

index = indexes.detect do |index|
index = indexes.detect do |idx|
if column_names.any?
index.columns == column_names
idx.columns == column_names
elsif name
matches_name?(index, name)
matches_name?(idx, name)
end
end

Expand Down
2 changes: 0 additions & 2 deletions lib/remockable/active_record/have_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
end

def method_missing(method, *args, &block)
unsupported_query_methods = %w(create_with)

query_methods = %w(
eager_load
from
Expand Down
6 changes: 3 additions & 3 deletions spec/active_record/accept_nested_attributes_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
let(:options) { :company }

it 'matches if the model accepts the nested attributes' do
model.accepts_nested_attributes_for *options
expect(model).to accept_nested_attributes_for *options
model.accepts_nested_attributes_for(*options)
expect(model).to accept_nested_attributes_for(*options)
end

it 'does not match if the model does not accept the nested attributes' do
expect(model).to_not accept_nested_attributes_for *options
expect(model).to_not accept_nested_attributes_for(*options)
end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/active_record/belong_to_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
let(:options) { :company }

it 'matches if the association exists' do
model.belongs_to *options
expect(model).to belong_to *options
model.belongs_to(*options)
expect(model).to belong_to(*options)
end

it 'does not match if the association does not exist' do
expect(model).to_not belong_to *options
expect(model).to_not belong_to(*options)
end

it 'does not match if the association is of the wrong type' do
model.has_many *options
expect(model).to_not belong_to *options
model.has_many(*options)
expect(model).to_not belong_to(*options)
end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/active_record/have_and_belong_to_many_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
let(:options) { :tags }

it 'matches if the association exists' do
model.has_and_belongs_to_many *options
expect(model).to have_and_belong_to_many *options
model.has_and_belongs_to_many(*options)
expect(model).to have_and_belong_to_many(*options)
end

it 'does not match if the association does not exist' do
expect(model).to_not have_and_belong_to_many *options
expect(model).to_not have_and_belong_to_many(*options)
end

it 'does not match if the association is of the wrong type' do
model.has_many *options
expect(model).to_not have_and_belong_to_many *options
model.has_many(*options)
expect(model).to_not have_and_belong_to_many(*options)
end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/active_record/have_one_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
let(:options) { :address }

it 'matches if the association exists' do
model.has_one *options
expect(model).to have_one *options
model.has_one(*options)
expect(model).to have_one(*options)
end

it 'does not match if the association does not exist' do
expect(model).to_not have_one *options
expect(model).to_not have_one(*options)
end

it 'does not match if the association is of the wrong type' do
model.has_many *options
expect(model).to_not have_one *options
model.has_many(*options)
expect(model).to_not have_one(*options)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/support/class_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.name
end
EVAL

class_eval &block if block_given?
class_eval(&block) if block_given?
end
end

Expand Down