Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX THIS CODE TO WORK WITH I18N #63

Open
github-actions bot opened this issue Jan 19, 2024 · 0 comments
Open

FIX THIS CODE TO WORK WITH I18N #63

github-actions bot opened this issue Jan 19, 2024 · 0 comments
Labels

Comments

@github-actions
Copy link

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
@github-actions github-actions bot added the todo label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants