diff --git a/spec/controllers/articles_controller_spec.rb b/spec/controllers/articles_controller_spec.rb index c15d200..06e26e6 100644 --- a/spec/controllers/articles_controller_spec.rb +++ b/spec/controllers/articles_controller_spec.rb @@ -37,8 +37,10 @@ expect do post :create, params: { article: { name_ru: created_article.name_ru, name_en: created_article.name_en, + name_be: created_article.name_be, description_ru: created_article.description_ru, description_en: created_article.description_en, + description_be: created_article.description_be, images: [file] } } end.to change(Article, :count).by(1) expect(response).to redirect_to(assigns(:article)) diff --git a/spec/factories/articles.rb b/spec/factories/articles.rb index b6f3ea0..82cd550 100644 --- a/spec/factories/articles.rb +++ b/spec/factories/articles.rb @@ -5,13 +5,16 @@ FactoryBot.define do factory :article do link_to_default_image = Rails.root.join('spec/files/images/image6.jpg') + name_ru { Faker::Lorem.characters(number: 10) } name_en { Faker::Lorem.characters(number: 10) } + name_be { Faker::Lorem.characters(number: 10) } description_ru { Faker::Lorem.characters(number: 30) } description_en { Faker::Lorem.characters(number: 30) } + description_be { Faker::Lorem.characters(number: 30) } after :build do |article| - article.images.attach(io: File.open(Rails.root.join(link_to_default_image)), filename: 'image6.jpg', content_type: 'image/jpg') + article.images.attach(io: File.open(link_to_default_image), filename: 'image6.jpg', content_type: 'image/jpg') end end end