2019-11-29 09:30:54 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 05:27:38 +03:00
|
|
|
RSpec.describe NewPostResultSerializer do
|
2019-11-29 09:30:54 -05:00
|
|
|
it "includes the message and route_to if present" do
|
|
|
|
result = NewPostResult.new(:custom, true)
|
2023-01-09 11:18:21 +00:00
|
|
|
result.message = "hello :)"
|
2019-11-29 09:30:54 -05:00
|
|
|
result.route_to = "/cool-route"
|
|
|
|
|
|
|
|
serializer = described_class.new(result)
|
|
|
|
expect(serializer.success).to eq(true)
|
2023-01-09 11:18:21 +00:00
|
|
|
expect(serializer.message).to eq("hello :)")
|
|
|
|
expect(serializer.route_to).to eq("/cool-route")
|
2019-11-29 09:30:54 -05:00
|
|
|
end
|
|
|
|
end
|