Skip to content

Commit

Permalink
Merge 55090ed into 2da3340
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Feb 1, 2020
2 parents 2da3340 + 55090ed commit c2ab0bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/status_message.rb
Expand Up @@ -58,7 +58,7 @@ def self.tag_stream(tag_ids)
end

def nsfw
text.try(:match, /#nsfw/i) || super
!!(text.try(:match, /#nsfw/i) || super) # rubocop:disable Style/DoubleNegation
end

def comment_email_subject
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/api/posts_controller_spec.rb
Expand Up @@ -80,7 +80,7 @@

context "access full post by post ID" do
it "gets post" do
base_params = {status_message: {text: "myText"}, public: true}
base_params = {status_message: {text: "myText #nsfw"}, public: true}
poll_params = {poll_question: "something?", poll_answers: %w[yes no maybe]}
location_params = {location_address: "somewhere", location_coords: "1,2"}
merged_params = base_params.merge(location_params)
Expand Down Expand Up @@ -694,7 +694,7 @@ def confirm_post_top_level(post, reference_post)
expect(post["post_type"]).to eq(reference_post.post_type)
expect(post["provider_display_name"]).to eq(reference_post.provider_display_name)
expect(post["public"]).to eq(reference_post.public)
expect(post["nsfw"]).to eq(reference_post.nsfw)
expect(post["nsfw"]).to eq(!!reference_post.nsfw) # rubocop:disable Style/DoubleNegation
end

def confirm_interactions(interactions, reference_post)
Expand Down

0 comments on commit c2ab0bb

Please sign in to comment.