Skip to content

Commit

Permalink
add basic user entity to dummy app
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 26, 2024
1 parent e0217f0 commit b30e88d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class User < ApplicationRecord
include Federails::Entity

acts_as_federails_actor username_field: :id, name_field: :id
end
7 changes: 7 additions & 0 deletions spec/dummy/db/migrate/20241126151046_create_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class CreateUsers < ActiveRecord::Migration[8.0]
def change
create_table :users do |t|
t.timestamps
end
end
end
4 changes: 4 additions & 0 deletions spec/dummy/spec/factories/users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FactoryBot.define do
factory :user do
end
end
5 changes: 0 additions & 5 deletions spec/factories/actor.rb

This file was deleted.

4 changes: 2 additions & 2 deletions spec/requests/reports_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RSpec.describe "Reports" do
let(:actor) { create :actor }
let(:user) { create :user }
let(:report_body) {
<<-EOF
{
Expand All @@ -17,6 +17,6 @@

it "should call registered Report handler when a flag is received by Federails" do
expect(Federails::Moderation::Report).to receive(:handle_flag).once.and_call_original
post actor.inbox_url, params: report_body, headers: { content_type: "application/activity" }
post user.actor.inbox_url, params: report_body, headers: { content_type: "application/activity" }
end
end

0 comments on commit b30e88d

Please sign in to comment.