AlchemyCMS/alchemy_cms

View on GitHub
lib/alchemy/test_support/shared_uploader_examples.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

RSpec.shared_examples_for "having a json uploader error message" do
  it "renders json response with error message" do
    subject
    expect(response.media_type).to eq("application/json")
    expect(response.status).to eq(422)
    json = JSON.parse(response.body)
    expect(json).to have_key("message")
  end
end