Sha256: 1403c2416e0e16ee1baabd075151e69b7137044620b815d4b105db6ed18df497

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 Bytes

Contents

require 'rails_helper'

module Pwb
  RSpec.describe Api::V1::PropertiesController, type: :controller do
    routes { Pwb::Engine.routes }
    context 'with admin user' do
      login_admin_user

      let(:bulk_create_input ) do
        File.read(fixture_path + "/params/bulk_create.json")
      end

      describe 'bulk create' do
        it 'creates multiple properties' do
          propertiesJSON =  {
            propertiesJSON: bulk_create_input
          }


          expect{
            post :bulk_create, params: propertiesJSON
          }.to change(Prop,:count).by(4)
          expect(response.status).to eq(200)
          expect(response.content_type).to eq('application/json')

          # expect(I18n.t(I18n::Backend::ActiveRecord::Translation.last.key)).to eq(propertiesJSON[:i18n_value])
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pwb-1.2.0 spec/controllers/pwb/api/v1/propeties_controller_spec.rb
pwb-1.1.1 spec/controllers/pwb/api/v1/propeties_controller_spec.rb
pwb-1.0.0 spec/controllers/pwb/api/v1/propeties_controller_spec.rb