From 6c22e1b5c2f0162ffe4adbc2e20e9520b847e6a8 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 16:59:54 +0900 Subject: [PATCH] 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 --- spec/models/fluentd_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/models/fluentd_spec.rb b/spec/models/fluentd_spec.rb index 8581d2a..b23f238 100644 --- a/spec/models/fluentd_spec.rb +++ b/spec/models/fluentd_spec.rb @@ -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