@@ -17,7 +17,6 @@ module BetterTogether
1717 describe 'ActiveModel validations' do
1818 it { is_expected . to validate_presence_of ( :title ) }
1919 it { is_expected . to validate_presence_of ( :privacy ) }
20- it { is_expected . to validate_presence_of ( :language ) }
2120 end
2221
2322 describe 'Attributes' do
@@ -26,20 +25,18 @@ module BetterTogether
2625 it { is_expected . to respond_to ( :content ) }
2726 it { is_expected . to respond_to ( :meta_description ) }
2827 it { is_expected . to respond_to ( :keywords ) }
29- it { is_expected . to respond_to ( :published ) }
3028 it { is_expected . to respond_to ( :published_at ) }
3129 it { is_expected . to respond_to ( :privacy ) }
3230 it { is_expected . to respond_to ( :layout ) }
3331 it { is_expected . to respond_to ( :template ) }
34- it { is_expected . to respond_to ( :language ) }
3532 it { is_expected . to respond_to ( :protected ) }
3633 end
3734
3835 describe 'Scopes' do
3936 describe '.published' do
4037 it 'returns only published pages' do
4138 published_page_count = Page . published . count
42- create ( :better_together_page , published : false )
39+ create ( :better_together_page , published_at : nil )
4340 expect ( Page . published . count ) . to eq ( published_page_count )
4441 end
4542 end
@@ -62,12 +59,12 @@ module BetterTogether
6259 describe 'Methods' do
6360 describe '#published?' do
6461 it 'returns true if the page is published' do
65- page . published = true
62+ page . published_at = Time . now - 2 . days
6663 expect ( page . published? ) . to be true
6764 end
6865
6966 it 'returns false if the page is not published' do
70- page . published = false
67+ page . published_at = nil
7168 expect ( page . published? ) . to be false
7269 end
7370 end
0 commit comments