Correct deprecation warnings in specs

master
Guillaume Dott 2014-09-23 17:17:35 +02:00
parent f7a0872533
commit debfa686b9
2 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,7 @@ describe TheModerator::Model do
page = Page.new(name: 'Name', content: 'Content')
page.moderate(:name)
expect(page.moderations).to have(1).moderation
expect(page.moderations.size).to eq(1)
expect(page.moderations.first.data[:attributes]).to include(name: 'Name')
expect(page.name).to be_nil
expect(page.content).to eq('Content')
@ -21,7 +21,7 @@ describe TheModerator::Model do
name: 'name', content: 'content', id: category.page.id}}
category.moderate(page: :name)
expect(category.moderations).to have(1).moderation
expect(category.moderations.size).to eq(1)
expect(category.moderations.first.data[:attributes])
.to include(page_attributes: {name: 'name', id: category.page.id})
expect(category.page.name).to be_nil
@ -35,7 +35,7 @@ describe TheModerator::Model do
page.attributes = {links_attributes: [{id: link.id, name: 'link'}]}
page.moderate(links: [:name])
expect(page.moderations).to have(1).moderation
expect(page.moderations.size).to eq(1)
expect(page.moderations.first.data[:attributes])
.to include(links_attributes: {link.id => {name: 'link', id: link.id}})
expect(link.name).to be_nil
@ -47,8 +47,8 @@ describe TheModerator::Model do
page = Page.new(name: 'Name', content: 'Content')
page.moderate(:name)
expect(page.moderated?(:name)).to be_true
expect(page.moderated?(:content)).to be_false
expect(page.moderated?(:name)).to be true
expect(page.moderated?(:content)).to be false
end
end
end

View File

@ -15,7 +15,7 @@ describe TheModerator::ModerationModel do
subject.accept
expect(subject.moderatable.name).to eq('Name')
expect(subject.destroyed?).to be_true
expect(subject.destroyed?).to be true
end
end
@ -25,7 +25,7 @@ describe TheModerator::ModerationModel do
subject.discard
expect(subject.moderatable.name).to be_nil
expect(subject.destroyed?).to be_true
expect(subject.destroyed?).to be true
end
end
@ -34,15 +34,15 @@ describe TheModerator::ModerationModel do
expect(subject.moderatable.name).to be_nil
preview = subject.preview
expect(preview.frozen?).to be_true
expect(preview.frozen?).to be true
expect(preview.name).to eq('Name')
end
end
describe '#include?' do
it 'includes name' do
expect(subject.include?(:name)).to be_true
expect(subject.include?(:content)).to be_false
expect(subject.include?(:name)).to be true
expect(subject.include?(:content)).to be false
end
end
end