spec/column_spec.rb in schema_plus-1.8.6 vs spec/column_spec.rb in schema_plus-1.8.7
- old
+ new
@@ -3,11 +3,11 @@
describe "Column" do
before(:all) do
class User < ::ActiveRecord::Base ; end
end
-
+
let(:migration) { ::ActiveRecord::Migration }
context "JSON serialization" do
before(:each) do
create_table(User, :login => { :index => true})
@@ -30,11 +30,11 @@
context "regarding indexes" do
context "if not unique" do
- before(:each) do
+ before(:each) do
create_table(User, :login => { :index => true})
@login = User.columns.find{|column| column.name == "login"}
end
it "should report not unique" do
@@ -46,11 +46,11 @@
expect(@login.unique_scope).to be_nil
end
end
context "if unique single column" do
- before(:each) do
+ before(:each) do
create_table(User, :login => { :index => :unique})
@login = User.columns.find{|column| column.name == "login"}
end
it "should report unique" do
@@ -62,10 +62,10 @@
end
end
context "if unique multicolumn" do
- before(:each) do
+ before(:each) do
create_table(User, :first => {}, :middle => {}, :last => { :index => {:with => [:first, :middle], :unique => true}})
@first = User.columns.find{|column| column.name == "first"}
@middle = User.columns.find{|column| column.name == "middle"}
@last = User.columns.find{|column| column.name == "last"}
end