Skip to content

FIX THIS CODE TO WORK WITH I18N #63

@github-actions

Description

@github-actions

if options[:i18n]

expect(subject.errors.full_messages).to match_array(["Title en can't be blank", "Attachment Needs to be reattached"])

expect(subject.errors.attribute_names).to match_array([:title_en, :attachment])

else

expect(subject.errors.full_messages).to match_array(["Title can't be blank", "Title is too short (under 15 characters)", "Attachment Needs to be reattached"])

expect(subject.errors.attribute_names).to match_array([:title, :attachment])

end

# TODO: FIX THIS CODE TO WORK WITH I18N

      it "adds an error to the `:attachment` field" do
        expect(subject).not_to be_valid

        # TODO: FIX THIS CODE TO WORK WITH I18N
        #         if options[:i18n]
        #           expect(subject.errors.full_messages).to match_array(["Title en can't be blank", "Attachment Needs to be reattached"])
        #           expect(subject.errors.attribute_names).to match_array([:title_en, :attachment])
        #         else
        #           expect(subject.errors.full_messages).to match_array(["Title can't be blank", "Title is too short (under 15 characters)", "Attachment Needs to be reattached"])
        #           expect(subject.errors.attribute_names).to match_array([:title, :attachment])
        #         end
        expect(subject.errors.full_messages).to match_array(["Title can't be blank", "Attachment Needs to be reattached"])
        expect(subject.errors.attribute_names).to match_array([:title, :attachment])
      end
    end
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions