spec/models/section_spec.rb in adminpanel-1.2.12 vs spec/models/section_spec.rb in adminpanel-2.0.0
- old
+ new
@@ -1,8 +1,8 @@
require 'spec_helper'
-require 'support/test_database'
+
describe Adminpanel::Section do
before do
@section = Adminpanel::Section.new(
:name => "Section name",
:description => "Test description for index",
@@ -13,29 +13,22 @@
)
end
subject { @section }
- it { should respond_to(:description) }
- it { should respond_to(:has_image) }
- it { should respond_to(:key) }
- it { should respond_to(:name) }
- it { should respond_to(:has_description) }
- it { should respond_to(:page) }
-
- describe "when key is telephone and has less than 10 chars" do
+ describe 'when key is telephone and has less than 10 chars' do
before do
- @section.key = "telephone"
- @section.description = "1" * 9
+ @section.key = 'telephone'
+ @section.description = '1' * 9
end
it { @section.valid? eq false}
end
- describe "when key is telephone and has more than 10 chars" do
+ describe 'when key is telephone and has more than 10 chars' do
before do
- @section.key = "telephone"
- @section.description = "1" * 11
+ @section.key = 'telephone'
+ @section.description = '1' * 11
end
it { @section.valid? eq false}
end
describe "when key is telephone and has 10 chars" do
@@ -61,8 +54,8 @@
before {@section.description = " "}
it { @section.valid? eq false}
end
describe "default scope" do
- it { expect(Adminpanel::Section.scoped.to_sql).to eq Adminpanel::Section.reorder('').order('page ASC').to_sql}
+ it { expect(Adminpanel::Section.all.to_sql).to eq Adminpanel::Section.reorder('').order('page ASC').to_sql}
end
end