Fix deprecation warnings

> DEPRECATION WARNING: ActiveModel::Errors#get is deprecated and will be
> removed in Rails 5.1. To achieve the same use
> model.errors[:config_file].

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-04-18 16:59:54 +09:00
parent 5f9bb9f8fb
commit 6c22e1b5c2

View File

@ -21,19 +21,19 @@ describe Fluentd do
context "not writable" do
before { FileUtils.chmod(0400, path) }
it { should_not be_blank }
it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_write_permission')) }
it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_write_permission')) }
end
context "not readable" do
before { FileUtils.chmod(0200, path) }
it { should_not be_blank }
it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_read_permission')) }
it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_read_permission')) }
end
context "is directory" do
before { fluentd.send("#{column}=", Rails.root + "tmp") }
it { should_not be_blank }
it { subject.get(column).should include(I18n.t('activerecord.errors.messages.is_a_directory')) }
it { subject[column].should include(I18n.t('activerecord.errors.messages.is_a_directory')) }
end
end
@ -50,7 +50,7 @@ describe Fluentd do
context "not writable" do
before { FileUtils.chmod(0500, dir) }
it { should_not be_blank }
it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_write_permission')) }
it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_write_permission')) }
end
end
end