From 87f0a383bccb19c0921890f52d596bd6ff3c1862 Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Wed, 1 Jan 2025 08:10:17 +1030 Subject: [PATCH] Much better test fixtures --- test/fixtures/api_keys.yml | 4 +-- test/fixtures/pages.yml | 20 +++++++----- test/fixtures/posts.yml | 62 ++++++++++++++++++++++++++++---------- test/fixtures/users.yml | 37 ++++++++++++++++++++--- 4 files changed, 92 insertions(+), 31 deletions(-) diff --git a/test/fixtures/api_keys.yml b/test/fixtures/api_keys.yml index 2902bee..9405e52 100644 --- a/test/fixtures/api_keys.yml +++ b/test/fixtures/api_keys.yml @@ -1,7 +1,7 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -one: +admin_key: key: <%= SecureRandom.hex(20) %> -two: +test_key: key: <%= SecureRandom.hex(20) %> diff --git a/test/fixtures/pages.yml b/test/fixtures/pages.yml index 4e8457e..389e804 100644 --- a/test/fixtures/pages.yml +++ b/test/fixtures/pages.yml @@ -1,13 +1,17 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -one: - title: Page One - slug: page-one-<%= SecureRandom.hex(4) %> - content: MyText +about: + title: About mind reader + slug: about-<%= SecureRandom.hex(4) %> + content: | + Welcome to mind reader. This is a space for critical analysis of technology, capitalism, and social change. + The goal is to understand how these forces shape our world and imagine better futures. visibility: 1 -two: - title: Page Two - slug: page-two-<%= SecureRandom.hex(4) %> - content: MyText +privacy: + title: Privacy Policy + slug: privacy-<%= SecureRandom.hex(4) %> + content: | + mind reader respects your privacy. We only collect essential data needed to provide our services. + Your data is never sold or shared with third parties. visibility: 1 diff --git a/test/fixtures/posts.yml b/test/fixtures/posts.yml index f2901fe..d78e101 100644 --- a/test/fixtures/posts.yml +++ b/test/fixtures/posts.yml @@ -1,21 +1,51 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html +# +tech_dispatch: + post_type: dispatch + title: The Hidden Costs of AI Development + slug: hidden-costs-ai-<%= SecureRandom.hex(4) %> + published_at: <%= Time.current - 2.days %> + excerpt: Examining the environmental and social impacts of training large language models + tags: AI, technology, climate + content: | + The rise of large language models has transformed the tech landscape, but at what cost? + This analysis explores the hidden environmental and social impacts of AI development. + + We need to consider: + - Energy consumption of training + - Data center infrastructure + - Labor conditions in the AI supply chain + url: -one: +social_dispatch: post_type: dispatch - title: Post One - slug: post-one-<%= SecureRandom.hex(4) %> - published_at: 2024-09-14 17:08:02 - excerpt: MyText - tags: MyText - content: MyText - url: https://example.com/1 + title: Reimagining Social Media + slug: reimagining-social-<%= SecureRandom.hex(4) %> + published_at: <%= Time.current - 5.days %> + excerpt: A critical look at alternative social media platforms + tags: social media, technology, community + content: | + What would social media look like if it was designed for human flourishing instead of profit? + + This piece explores existing alternatives and imagines new possibilities. + url: + +tech_bookmark: + post_type: bookmark + title: The Environmental Impact of ChatGPT + slug: chatgpt-environment-<%= SecureRandom.hex(4) %> + published_at: <%= Time.current - 1.day %> + excerpt: MIT Technology Review examines ChatGPT's carbon footprint + tags: AI, climate, technology + content: Fascinating analysis of the environmental costs of running large language models + url: https://example.com/chatgpt-impact -two: +social_bookmark: post_type: bookmark - title: Post Two - slug: post-two-<%= SecureRandom.hex(4) %> - published_at: 2024-09-14 17:08:02 - excerpt: MyText - tags: MyText - content: MyText - url: https://example.com/2 + title: Platform Cooperativism Now + slug: platform-coop-<%= SecureRandom.hex(4) %> + published_at: <%= Time.current - 3.days %> + excerpt: How worker-owned platforms are challenging the gig economy + tags: cooperatives, technology, labor + content: Great overview of the growing platform cooperativism movement + url: https://example.com/platform-coops diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index d7a3329..d2d415b 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -4,8 +4,35 @@ # model remove the "{}" from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} -# column: value -# -two: {} -# column: value +admin: + email: admin@example.com + first_name: Admin + last_name: User + admin: true + encrypted_password: <%= BCrypt::Password.create('password123') %> + confirmed_at: <%= Time.current - 1.month %> + support_type: ongoing + subscription_status: active + buttondown_status: premium + +regular_user: + email: user@example.com + first_name: Regular + last_name: User + admin: false + encrypted_password: <%= BCrypt::Password.create('password123') %> + confirmed_at: <%= Time.current - 2.weeks %> + support_type: non_financial + subscription_status: + buttondown_status: unpaid + +paid_user: + email: paid@example.com + first_name: Paid + last_name: User + admin: false + encrypted_password: <%= BCrypt::Password.create('password123') %> + confirmed_at: <%= Time.current - 1.week %> + support_type: one_time + subscription_status: one_time + buttondown_status: premium -- 2.39.5