Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: manyfold3d/manyfold
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6d02c57c6dc71bd43c4f0848c4c2a1f13e3864c0
Choose a base ref
..
head repository: manyfold3d/manyfold
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 302ab05ea3a7e6bcad528a8050045fd91382c10d
Choose a head ref
Showing with 7 additions and 8 deletions.
  1. +1 −2 app/jobs/activity/creator_added_model_job.rb
  2. +6 −6 spec/jobs/activity/creator_added_model_job_spec.rb
3 changes: 1 addition & 2 deletions app/jobs/activity/creator_added_model_job.rb
Original file line number Diff line number Diff line change
@@ -10,8 +10,7 @@ def perform(model_id)
comment: I18n.t("jobs.activity.creator_added_model.comment",
model_name: model.name,
url: model.actor.profile_url,
tags: model.tag_list.map{|t| "##{t}"}.join(' ')
)
tags: model.tag_list.map { |t| "##{t}" }.join(" "))
)
end
end
12 changes: 6 additions & 6 deletions spec/jobs/activity/creator_added_model_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
require "rails_helper"

RSpec.describe Activity::CreatorAddedModelJob do
let(:creator) { create :creator }
let(:model) { create :model, creator: creator, tag_list: "tag1, tag2" }
let(:creator) { create(:creator) }
let(:model) { create(:model, creator: creator, tag_list: "tag1, tag2") }

it "adds a comment" do
expect{described_class.new.perform(model.id)}.to change(Comment, :count).by(1)
expect { described_class.new.perform(model.id) }.to change(Comment, :count).by(1)
end

it "ends up queueing an ActivityPub publish job" do
expect{described_class.new.perform(model.id)}.to have_enqueued_job Federails::NotifyInboxJob
expect { described_class.new.perform(model.id) }.to have_enqueued_job Federails::NotifyInboxJob
end

context "with a comment" do
subject(:comment) { model.comments.first }

before do
described_class.new.perform(model.id)
end

subject(:comment) { model.comments.first }

it "sets creator as author" do
expect(comment.commenter).to eq creator
end