remockable 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ RSpec::Matchers.define(:have_column) do |*attributes|
|
|
7
7
|
valid_options %w(default limit null precision scale type)
|
8
8
|
|
9
9
|
match do |actual|
|
10
|
-
if column = subject.columns.detect { |column| column.name == @column.to_s }
|
10
|
+
if column = subject.class.columns.detect { |column| column.name == @column.to_s }
|
11
11
|
@expected.all? { |key, value| column.send(key).should == value }
|
12
12
|
end
|
13
13
|
end
|
@@ -9,7 +9,7 @@ RSpec::Matchers.define(:have_index) do |*attributes|
|
|
9
9
|
match do |actual|
|
10
10
|
name = @expected[:name]
|
11
11
|
unique = @expected[:unique]
|
12
|
-
indexes = ActiveRecord::Base.connection.indexes(subject.table_name)
|
12
|
+
indexes = ActiveRecord::Base.connection.indexes(subject.class.table_name)
|
13
13
|
|
14
14
|
column_names = @columns.flatten.collect(&:to_s)
|
15
15
|
|