docbrown/spec/factories/api_secrets.rb
cyrillefr 70631ad2f7 Listings creation and update API (#4014)
* Listings creation and update API

  - new listings controller
  - refactored code to share core functionnality between api and web controllers
  - code in common in classified listing concerns
  - added tests for index/create/update
  - json output as views
  - updated a factory

* Listings creation and update API: code update

  - refactored json calls
  - added test cases
  - added pagination for list of listings
  - refactored jbuilder files
  - typos

* Listings creation and update API: code update

  - tags and tag_list in controller
  - changed view to display both
  - refactored and added test

* Listings creation and update API: code update

  - small change to resolve conflit

* Listings creation and update API: code update

  - added test case
  - deleted unneeded test case
2019-09-24 07:03:52 -07:00

14 lines
373 B
Ruby

FactoryBot.define do
factory :api_secret do
user
description { Faker::Lorem.sentence }
secret { SecureRandom.base58(24) }
end
trait :org_admin do
after(:create) do |api_secret|
org = create(:organization)
create(:organization_membership, user_id: api_secret.user.id, organization_id: org.id, type_of_user: "admin")
end
end
end