repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20221206231914_add_enclosure_url_to_stories.rb
db/migrate/20221206231914_add_enclosure_url_to_stories.rb
# frozen_string_literal: true class AddEnclosureUrlToStories < ActiveRecord::Migration[4.2] def change add_column(:stories, :enclosure_url, :string) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20230301024452_encrypt_api_key.rb
db/migrate/20230301024452_encrypt_api_key.rb
# frozen_string_literal: true class EncryptAPIKey < ActiveRecord::Migration[7.0] def change ActiveRecord::Encryption.config.support_unencrypted_data = true encrypt_api_keys ActiveRecord::Encryption.config.support_unencrypted_data = false change_column_null :users, :api_key, false add_index :us...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20240316211109_add_stories_order_to_users.rb
db/migrate/20240316211109_add_stories_order_to_users.rb
# frozen_string_literal: true class AddStoriesOrderToUsers < ActiveRecord::Migration[7.1] def change add_column :users, :stories_order, :string, default: "desc" end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20130504005816_text_url.rb
db/migrate/20130504005816_text_url.rb
# frozen_string_literal: true class TextUrl < ActiveRecord::Migration[4.2] def up change_column :feeds, :url, :text end def down change_column :feeds, :url, :string end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20130425222157_add_delayed_job.rb
db/migrate/20130425222157_add_delayed_job.rb
# frozen_string_literal: true class AddDelayedJob < ActiveRecord::Migration[4.2] def self.up create_table :delayed_jobs, force: true do |table| # Allows some jobs to jump to the front of the queue table.integer :priority, default: 0 # Provides for retries, but still fail eventually. tabl...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20130409010818_create_feeds.rb
db/migrate/20130409010818_create_feeds.rb
# frozen_string_literal: true class CreateFeeds < ActiveRecord::Migration[4.2] def change create_table :feeds do |t| t.string :name t.string :url t.timestamp :last_fetched t.timestamps null: false end end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20230801025232_create_good_job_batches.rb
db/migrate/20230801025232_create_good_job_batches.rb
# frozen_string_literal: true class CreateGoodJobBatches < ActiveRecord::Migration[7.0] def change reversible do |dir| dir.up do # Ensure this incremental update migration is idempotent # with monolithic install migration. return if connection.table_exists?(:good_job_batches) ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20130805113712_update_stories_unique_constraints.rb
db/migrate/20130805113712_update_stories_unique_constraints.rb
# frozen_string_literal: true class UpdateStoriesUniqueConstraints < ActiveRecord::Migration[4.2] def up remove_index :stories, [:permalink, :feed_id] add_index :stories, [:entry_id, :feed_id], unique: true, length: { permalink: 767 } end def down remove_ind...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/db/migrate/20130504022615_change_story_permalink_column.rb
db/migrate/20130504022615_change_story_permalink_column.rb
# frozen_string_literal: true class ChangeStoryPermalinkColumn < ActiveRecord::Migration[4.2] def up change_column :stories, :permalink, :text end def down change_column :stories, :permalink, :string end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/rails_helper.rb
spec/rails_helper.rb
# frozen_string_literal: true require "spec_helper" ENV["RAILS_ENV"] ||= "test" require_relative "support/coverage" require_relative "../config/environment" # Prevent database truncation if the environment is production if Rails.env.production? abort("The Rails environment is running in production mode!") end requi...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true RSpec.configure do |config| config.expect_with(:rspec) do |expectations| # This option will default to `true` in RSpec 4. It makes the `description` # and `failure_message` of custom matchers include text for helper methods # defined using `chain`, e.g.: # be_bigger_...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/tasks/remove_old_stories_spec.rb
spec/tasks/remove_old_stories_spec.rb
# frozen_string_literal: true RSpec.describe RemoveOldStories do def create_stories stories = double("stories") allow(stories).to receive(:delete_all) stories end it "passes along the number of days to the story repository query" do allow(described_class).to receive(:pruned_feeds).and_return([])...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/jobs/callable_job_spec.rb
spec/jobs/callable_job_spec.rb
# frozen_string_literal: true RSpec.describe CallableJob do it "calls the callable" do callable = ->(*, **) {} expect { described_class.perform_now(callable, "foo", bar: "baz") } .to invoke(:call).on(callable).with("foo", bar: "baz") end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/feeds_index_spec.rb
spec/system/feeds_index_spec.rb
# frozen_string_literal: true RSpec.describe "feeds/index" do it "displays a list of feeds" do login_as(default_user) create_pair(:feed) visit "/feeds" expect(page).to have_css("li.feed", count: 2) end it "displays message to add feeds if there are none" do login_as(default_user) visi...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/export_spec.rb
spec/system/export_spec.rb
# frozen_string_literal: true RSpec.describe "exporting feeds" do it "allows exporting feeds" do login_as(default_user) feed = create(:feed, :with_group) click_on "Export" xml = Capybara.string(Downloads.content_for(page, "stringer.opml")) expect(xml).to have_css("outline[title='#{feed.name}']"...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/import_spec.rb
spec/system/import_spec.rb
# frozen_string_literal: true RSpec.describe "importing feeds" do it "allows importing feeds" do login_as(default_user) visit(feeds_import_path) file_path = Rails.root.join("spec/fixtures/feeds.opml") attach_file("opml_file", file_path, visible: false) expect(page).to have_content("We're gettin...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/stories_index_spec.rb
spec/system/stories_index_spec.rb
# frozen_string_literal: true RSpec.describe "stories/index" do it "displays the stories" do create(:story, title: "My Story") login_as(default_user) visit news_path expect(page).to have_content("My Story") end it "does not display read stories" do create(:story, :read, title: "My Story") ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/account_setup_spec.rb
spec/system/account_setup_spec.rb
# frozen_string_literal: true RSpec.describe "account setup" do def fill_in_fields(username:) fill_in("Username", with: username) fill_in("Password", with: "my-password") fill_in("Confirm", with: "my-password") click_on("Next") end it "allows a user to sign up" do visit "/" fill_in_fiel...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/application_settings_spec.rb
spec/system/application_settings_spec.rb
# frozen_string_literal: true RSpec.describe "application settings" do it "allows enabling account creation" do login_as(create(:user, admin: true)) visit(settings_path) within("form", text: "User signups are disabled") { click_on("Enable") } expect(page).to have_content("User signups are enabled")...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/js_tests_spec.rb
spec/system/js_tests_spec.rb
# frozen_string_literal: true RSpec.describe "JS tests" do it "passes the mocha tests" do login_as(default_user) visit "/test" expect(page).to have_content("failures: 0") end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/profile_spec.rb
spec/system/profile_spec.rb
# frozen_string_literal: true RSpec.describe "profile page" do before do login_as(default_user) visit(edit_profile_path) end it "allows the user to edit their username" do fill_in_username_fields(default_user.password) click_on("Update username") expect(page).to have_text("Logged in as new_...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/system/good_job_spec.rb
spec/system/good_job_spec.rb
# frozen_string_literal: true RSpec.describe "admin/good_job" do it "displays the GoodJob dashboard" do login_as(create(:user, admin: true)) a11y_skip = [ "aria-required-children", "color-contrast", "document-title", "landmark-unique", "landmark-one-main", "page-has-headin...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/matchers.rb
spec/support/matchers.rb
# frozen_string_literal: true module Matchers def change_all_records(records, attribute) Matchers::ChangeAllRecords.new(records, attribute) end def change_record(record, attribute) Matchers::ChangeRecord.new(record, attribute) end def delete_record(record) Matchers::DeleteRecord.new(record) e...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/capybara.rb
spec/support/capybara.rb
# frozen_string_literal: true require "capybara/rails" Capybara.enable_aria_label = true Selenium::WebDriver.logger.output = Rails.root.join("log/selenium.log") RSpec.configure do |config| config.before(:each, type: :system) do driven_by(:selenium, using: :firefox) do |driver| driver.add_preference("bro...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/system_helpers.rb
spec/support/system_helpers.rb
# frozen_string_literal: true module SystemHelpers def login_as(user) visit(login_path) fill_in("Username", with: user.username) fill_in("Password", with: user.password) click_on("Login") end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/generate_xml.rb
spec/support/generate_xml.rb
# frozen_string_literal: true module GenerateXml class << self def call(feed, items) build_feed(feed, items).to_xml end private def build_feed(feed, items) Nokogiri::XML::Builder.new do |xml| xml.rss(version: "2.0") do xml.title(feed.name) xml.link(feed.url) ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/coverage.rb
spec/support/coverage.rb
# frozen_string_literal: true return if ENV["COVERAGE"] == "false" require "simplecov" if ENV["CI"] require "coveralls" SimpleCov.formatter = Coveralls::SimpleCov::Formatter end SimpleCov.start(:rails) do add_group("Commands", "app/commands") add_group("Fever API", "app/fever_api") add_group("Repositories...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/downloads.rb
spec/support/downloads.rb
# frozen_string_literal: true module Downloads PATH = Rails.root.join("tmp/downloads") class << self def clear FileUtils.rm_f(downloads) end def content_for(page, filename) page.document.synchronize(errors: [Errno::ENOENT]) do File.read(PATH.join(filename)) end end ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/with_model.rb
spec/support/with_model.rb
# frozen_string_literal: true class WithModel::Model # Workaround for https://github.com/Casecommons/with_model/issues/35 def cleanup_descendants_tracking cache_classes = Rails.application.config.cache_classes if defined?(ActiveSupport::DescendantsTracker) && !cache_classes ActiveSupport::Descendants...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/axe_core.rb
spec/support/axe_core.rb
# frozen_string_literal: true require "axe-rspec" module AccessibilityOverrides A11Y_SKIP = [ "aria-required-children", "color-contrast", "landmark-one-main", "page-has-heading-one", "region" ].freeze def visit(*, accessible: true, a11y_skip: A11Y_SKIP) page.visit(*) yield if block...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/factory_bot.rb
spec/support/factory_bot.rb
# frozen_string_literal: true require "factory_bot" FactoryBot.find_definitions module FactoryCache def self.user @user ||= FactoryBot.create(:user) end def self.reset @user = nil end end RSpec.configure do |config| config.include(FactoryBot::Syntax::Methods) config.after do FactoryBot.rewi...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/webmock.rb
spec/support/webmock.rb
# frozen_string_literal: true require "webmock/rspec" WebMock.disable_net_connect!( allow_localhost: true, allow: [/geckodriver/, /chromedriver/] )
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/request_helpers.rb
spec/support/request_helpers.rb
# frozen_string_literal: true module RequestHelpers def login_as(user) post("/login", params: { username: user.username, password: user.password }) end def rendered Capybara.string(response.body) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/feed_server.rb
spec/support/feed_server.rb
# frozen_string_literal: true class FeedServer attr_writer :response def initialize @server = Capybara::Server.new(method(:response)).boot end def response(_env) [200, {}, [@response]] end def url "http://#{@server.host}:#{@server.port}" end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/matchers/delete_record.rb
spec/support/matchers/delete_record.rb
# frozen_string_literal: true class Matchers::DeleteRecord include RSpec::Matchers::Composable attr_reader :record def initialize(record) @record = record end def supports_block_expectations? true end def matches?(event_proc) perform_change(event_proc) exists_before? && !exists_after...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/matchers/invoke.rb
spec/support/matchers/invoke.rb
# frozen_string_literal: true require "active_support/core_ext/module/delegation" class Matchers::Invoke include RSpec::Matchers::Composable delegate :failure_message, :failure_message_when_negated, to: :received_matcher def initialize(expected_method) @expected_method = expected_met...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/matchers/change_record.rb
spec/support/matchers/change_record.rb
# frozen_string_literal: true class Matchers::ChangeRecord include RSpec::Matchers::Composable attr_reader :record, :attribute, :original_value, :new_value, :expected_new_value, :expected_original_value def initialize(record, attribute) ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/support/matchers/change_all_records.rb
spec/support/matchers/change_all_records.rb
# frozen_string_literal: true class Matchers::ChangeAllRecords include RSpec::Matchers::Composable attr_reader :records, :attribute, :original_values, :new_values, :expected_new_value, :expected_original_value def initialize(records, attribu...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/integration/feed_importing_spec.rb
spec/integration/feed_importing_spec.rb
# frozen_string_literal: true require "support/feed_server" RSpec.describe "Feed importing" do def create_server(url: "feed01_valid_feed/feed.xml") server = FeedServer.new server.response = sample_data(url) server end def create_feed(**) create( :feed, name: "Example feed", la...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/feeds_controller_spec.rb
spec/requests/feeds_controller_spec.rb
# frozen_string_literal: true RSpec.describe FeedsController do include ActiveJob::TestHelper describe "#index" do it "renders a list of feeds" do login_as(default_user) create_pair(:feed) get "/feeds" expect(rendered).to have_css("li.feed", count: 2) end it "displays messag...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/tutorials_controller_spec.rb
spec/requests/tutorials_controller_spec.rb
# frozen_string_literal: true RSpec.describe TutorialsController do describe "#index" do context "when a user has not been setup" do it "displays the tutorial and completes setup" do login_as(default_user) get "/setup/tutorial" expect(rendered).to have_css("#mark-all-instruction")...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/sessions_controller_spec.rb
spec/requests/sessions_controller_spec.rb
# frozen_string_literal: true RSpec.describe SessionsController do describe "#new" do it "has a password input and login button" do create(:user) get "/login" expect(rendered).to have_field("password") end end describe "#create" do it "denies access when password is incorrect" do...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/settings_controller_spec.rb
spec/requests/settings_controller_spec.rb
# frozen_string_literal: true RSpec.describe SettingsController do describe "#index" do it "displays the settings page" do login_as(create(:user, admin: true)) get(settings_path) expect(rendered).to have_css("h1", text: "Settings") .and have_text("User signups are disabled") end ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/imports_controller_spec.rb
spec/requests/imports_controller_spec.rb
# frozen_string_literal: true RSpec.describe ImportsController do describe "GET /feeds/import" do it "displays the import options" do login_as(default_user) get "/feeds/import" expect(rendered).to have_field("opml_file") end end describe "POST /feeds/import" do opml_file = Rack::...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/fever_controller_spec.rb
spec/requests/fever_controller_spec.rb
# frozen_string_literal: true RSpec.describe FeverController do def standard_answer { api_version: 3, auth: 1, last_refreshed_on_time: 0 } end def cannot_auth { api_version: 3, auth: 0 } end def response_as_object JSON.parse(response.body, symbolize_names: true) end def params(user: defaul...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/passwords_controller_spec.rb
spec/requests/passwords_controller_spec.rb
# frozen_string_literal: true RSpec.describe PasswordsController do describe "#new" do it "displays a form to enter your password" do get "/setup/password" expect(rendered).to have_css("form#password_setup") end it "redirects to the login page when signups are not enabled" do create(:...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/exports_controller_spec.rb
spec/requests/exports_controller_spec.rb
# frozen_string_literal: true RSpec.describe ExportsController do describe "GET /feeds/export" do def expected_xml <<~XML <?xml version="1.0"?> <opml version="1.0"> <head> <title>Feeds from Stringer</title> </head> <body/> </opml> XML ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/stories_controller_spec.rb
spec/requests/stories_controller_spec.rb
# frozen_string_literal: true RSpec.describe StoriesController do describe "GET /news" do it "redirects to the setup page when no user exists" do get "/news" expect(URI.parse(response.location).path).to eq("/setup/password") end it "redirects to the login page if not logged in" do cre...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/debug_controller_spec.rb
spec/requests/debug_controller_spec.rb
# frozen_string_literal: true RSpec.describe DebugController do describe "#debug" do def setup login_as(create(:user, admin: true)) expect(MigrationStatus) .to receive(:call) .and_return(["Migration B - 2", "Migration C - 3"]) end it "displays an admin settings link" do ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/requests/profiles_controller_spec.rb
spec/requests/profiles_controller_spec.rb
# frozen_string_literal: true RSpec.describe ProfilesController do describe "#edit" do it "displays the edit view" do login_as(default_user) get(edit_profile_path) expect(rendered).to have_text("Edit profile") .and have_field("Username", with: default_user.username) end end d...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/helpers/url_helpers_spec.rb
spec/helpers/url_helpers_spec.rb
# frozen_string_literal: true RSpec.describe UrlHelpers do def helper helper_class = Class.new { include UrlHelpers } helper_class.new end describe "#expand_absolute_urls" do it "preserves existing absolute urls" do content = '<a href="http://foo">bar</a>' expect(helper.expand_absolute_...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/cast_boolean_spec.rb
spec/commands/cast_boolean_spec.rb
# frozen_string_literal: true RSpec.describe CastBoolean do ["true", true, "1"].each do |true_value| it "returns true when passed #{true_value.inspect}" do expect(described_class.call(true_value)).to be(true) end end ["false", false, "0"].each do |false_value| it "returns false when passed #{f...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/user/sign_in_user_spec.rb
spec/commands/user/sign_in_user_spec.rb
# frozen_string_literal: true RSpec.describe SignInUser do it "returns the user if the password is valid" do result = described_class.call(default_user.username, default_user.password) expect(result).to eq(default_user) end it "returns nil if password is invalid" do create(:user) result = desc...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/sync_saved_item_ids_spec.rb
spec/commands/fever_api/sync_saved_item_ids_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::SyncSavedItemIds do it "returns a list of starred items if requested" do stories = create_list(:story, 3, :starred) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, saved_item_ids: nil)) .to eq(saved_...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/write_mark_item_spec.rb
spec/commands/fever_api/write_mark_item_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::WriteMarkItem do context "when as: 'read'" do it "marks the story as read" do story = create(:story) authorization = Authorization.new(story.user) params = { authorization:, mark: "item", as: "read", id: story.id } expect { subject.c...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_feeds_groups_spec.rb
spec/commands/fever_api/read_feeds_groups_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadFeedsGroups do it "returns a list of groups requested through feeds" do group = create(:group) feeds = create_list(:feed, 3, group:) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, feeds: nil)).to ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_items_spec.rb
spec/commands/fever_api/read_items_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadItems do it "returns a list of unread items including total count" do stories = create_list(:story, 3) authorization = Authorization.new(default_user) items = stories.map(&:as_fever_json) expect(described_class.call(authorization:, items: ni...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/write_mark_feed_spec.rb
spec/commands/fever_api/write_mark_feed_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::WriteMarkFeed do def params(feed, before:) authorization = Authorization.new(feed.user) { authorization:, mark: "feed", id: feed.id, before: } end it "marks the feed stories as read before the given timestamp" do feed = create(:feed) story ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_favicons_spec.rb
spec/commands/fever_api/read_favicons_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadFavicons do it "returns a fixed icon list if requested" do expect(described_class.call({ favicons: nil })).to eq( favicons: [ { id: 0, data: "image/gif;base64,#{described_class::ICON}" } ] ) end it...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_links_spec.rb
spec/commands/fever_api/read_links_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadLinks do it "returns a fixed link list if requested" do expect(described_class.call(links: nil)).to eq(links: []) end it "returns an empty hash otherwise" do expect(described_class.call({})).to eq({}) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/sync_unread_item_ids_spec.rb
spec/commands/fever_api/sync_unread_item_ids_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::SyncUnreadItemIds do it "returns a list of unread items if requested" do stories = create_list(:story, 3) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, unread_item_ids: nil)) .to eq(unread_item_ids...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/authentication_spec.rb
spec/commands/fever_api/authentication_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::Authentication do def authorization Authorization.new(default_user) end it "returns the latest feed's last_fetched time" do feed = create(:feed, last_fetched: 1.month.ago) create(:feed, last_fetched: 1.year.ago) result = described_class.cal...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_feeds_spec.rb
spec/commands/fever_api/read_feeds_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadFeeds do it "returns a list of feeds" do feeds = create_list(:feed, 3) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, feeds: nil)) .to eq(feeds: feeds.map(&:as_fever_json)) end it "returns ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/write_mark_group_spec.rb
spec/commands/fever_api/write_mark_group_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::WriteMarkGroup do def authorization Authorization.new(default_user) end it "marks the group stories as read before the given timestamp" do story = create(:story, :with_group, created_at: 1.week.ago) before = 1.day.ago id = story.group_id ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/fever_api/read_groups_spec.rb
spec/commands/fever_api/read_groups_spec.rb
# frozen_string_literal: true RSpec.describe FeverAPI::ReadGroups do it "returns a group list if requested" do groups = create_pair(:group) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, groups: nil)) .to eq(groups: [Group::UNGROUPED, *groups].map(&:as_...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_as_unread_spec.rb
spec/commands/story/mark_as_unread_spec.rb
# frozen_string_literal: true RSpec.describe MarkAsUnread do it "marks a story as unread" do story = create(:story, is_read: true) expect { described_class.call(story.id) } .to change_record(story, :is_read).from(true).to(false) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_feed_as_read_spec.rb
spec/commands/story/mark_feed_as_read_spec.rb
# frozen_string_literal: true RSpec.describe MarkFeedAsRead do it "marks feed stories as read before timestamp" do story = create(:story, created_at: 1.week.ago) before = 1.day.ago expect { described_class.call(story.feed_id, before) } .to change_record(story, :is_read).from(false).to(true) end ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_as_unstarred_spec.rb
spec/commands/story/mark_as_unstarred_spec.rb
# frozen_string_literal: true RSpec.describe MarkAsUnstarred do it "marks a story as unstarred" do story = create(:story, :starred) expect { described_class.call(story.id) } .to change_record(story, :is_starred).from(true).to(false) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_as_read_spec.rb
spec/commands/story/mark_as_read_spec.rb
# frozen_string_literal: true RSpec.describe MarkAsRead do it "marks a story as read" do story = create(:story, is_read: false) expect { described_class.call(story.id) } .to change_record(story, :is_read).from(false).to(true) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_group_as_read_spec.rb
spec/commands/story/mark_group_as_read_spec.rb
# frozen_string_literal: true RSpec.describe MarkGroupAsRead do describe "#mark_group_as_read" do it "marks group as read" do story = create(:story, :with_group, created_at: 1.week.ago) timestamp = 1.day.ago expect { described_class.call(story.group_id, timestamp) } .to change_record(s...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_all_as_read_spec.rb
spec/commands/story/mark_all_as_read_spec.rb
# frozen_string_literal: true RSpec.describe MarkAllAsRead do it "marks all stories as read" do stories = create_pair(:story) expect { described_class.call(stories.map(&:id)) } .to change_all_records(stories, :is_read).from(false).to(true) end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/story/mark_as_starred_spec.rb
spec/commands/story/mark_as_starred_spec.rb
# frozen_string_literal: true RSpec.describe MarkAsStarred do describe "#mark_as_starred" do it "marks a story as starred" do story = create(:story) expect { described_class.call(story.id) } .to change_record(story, :is_starred).from(false).to(true) end end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/export_to_opml_spec.rb
spec/commands/feed/export_to_opml_spec.rb
# frozen_string_literal: true RSpec.describe Feed::ExportToOpml do it "returns OPML XML" do feed_one, feed_two = build_pair(:feed) result = described_class.call([feed_one, feed_two]) outlines = Nokogiri.XML(result).xpath("//body//outline") expect(outlines.size).to eq(2) expect(outlines.first["ti...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/import_from_opml_spec.rb
spec/commands/feed/import_from_opml_spec.rb
# frozen_string_literal: true RSpec.describe Feed::ImportFromOpml do tmw_football = { name: "TMW Football Transfer News", url: "http://www.transfermarketweb.com/rss" } giant_robots = { name: "GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home", url: "http://feeds.feedburner.com/GiantRobotsSmas...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/fetch_all_spec.rb
spec/commands/feed/fetch_all_spec.rb
# frozen_string_literal: true RSpec.describe Feed::FetchAll do def stub_pool pool = instance_double(Thread::Pool) expect(Thread).to receive(:pool).and_return(pool) expect(pool).to receive(:process).at_least(:once).and_yield expect(pool).to receive(:shutdown) end it "calls Feed::FetchOne for ever...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/create_spec.rb
spec/commands/feed/create_spec.rb
# frozen_string_literal: true RSpec.describe Feed::Create do context "feed cannot be discovered" do it "returns false if cant discover any feeds" do expect(FeedDiscovery).to receive(:call).and_return(false) result = described_class.call("http://not-a-feed.com", user: default_user) expect(resul...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/fetch_one_spec.rb
spec/commands/feed/fetch_one_spec.rb
# frozen_string_literal: true RSpec.describe Feed::FetchOne do include ActiveSupport::Testing::TimeHelpers def create_entry(**options) entry = { published: Time.zone.now, title: "Run LLMs on my own Mac fast and efficient", url: "https://www.secondstate.io/articles/fast-llm-inference", ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/fetch_all_for_user_spec.rb
spec/commands/feed/fetch_all_for_user_spec.rb
# frozen_string_literal: true RSpec.describe Feed::FetchAllForUser do def stub_pool pool = instance_double(Thread::Pool) expect(Thread).to receive(:pool).and_return(pool) expect(pool).to receive(:process).at_least(:once).and_yield expect(pool).to receive(:shutdown) end it "calls Feed::FetchOne f...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/commands/feed/find_new_stories_spec.rb
spec/commands/feed/find_new_stories_spec.rb
# frozen_string_literal: true RSpec.describe Feed::FindNewStories do def create_entry(**options) entry = { published: nil, title: "story1", url: "www.story1.com", content: "", id: "www.story1.com", **options } double(entry) end def create_raw_feed(feed, entries: [...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/factories/users.rb
spec/factories/users.rb
# frozen_string_literal: true FactoryBot.define do factory(:user) do sequence(:username, 100) { |n| "user-#{n}" } password { "super-secret" } admin { false } end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/factories/groups.rb
spec/factories/groups.rb
# frozen_string_literal: true FactoryBot.define do factory(:group) do user { default_user } sequence(:name, 100) { |n| "Group #{n}" } end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/factories/stories.rb
spec/factories/stories.rb
# frozen_string_literal: true FactoryBot.define do factory(:story) do feed sequence(:entry_id, 100) { |n| "entry-#{n}" } sequence(:published, 100) { |n| n.days.ago } trait :read do is_read { true } end trait :starred do is_starred { true } end trait :with_group do ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/factories/feeds.rb
spec/factories/feeds.rb
# frozen_string_literal: true FactoryBot.define do factory(:feed) do user { default_user } sequence(:name, 100) { |n| "Feed #{n}" } sequence(:url, 100) { |n| "http://exampoo.com/#{n}" } trait :with_group do group end end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/group_spec.rb
spec/models/group_spec.rb
# frozen_string_literal: true RSpec.describe Group do describe "#as_fever_json" do it "returns a hash of the group in fever format" do group = described_class.new(id: 5, name: "wat group") expect(group.as_fever_json).to eq(id: 5, title: "wat group") end end end
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/migration_status_spec.rb
spec/models/migration_status_spec.rb
# frozen_string_literal: true RSpec.describe "MigrationStatus" do it "returns array of strings representing pending migrations" do migrator = ActiveRecord::Base.connection.pool.migration_context.open allow(migrator).to receive(:pending_migrations).and_return( [ ActiveRecord::Migration.new("Mig...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/feed_spec.rb
spec/models/feed_spec.rb
# frozen_string_literal: true RSpec.describe "Feed" do describe ".with_unread_stories_counts" do it "returns feeds with unread stories counts" do create(:story) feed = Feed.with_unread_stories_counts.first expect(feed.unread_stories_count).to eq(1) end it "includes feeds with no unre...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/application_record_spec.rb
spec/models/application_record_spec.rb
# frozen_string_literal: true RSpec.describe ApplicationRecord do describe ".boolean_accessor" do with_model :Cheese, superclass: described_class do table { |t| t.jsonb(:options, default: {}) } end describe "#<key>" do it "returns the value when present" do Cheese.boolean_accessor(:o...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/story_spec.rb
spec/models/story_spec.rb
# frozen_string_literal: true RSpec.describe "Story" do describe ".unread" do it "returns stories where is_read is false" do story = create(:story) expect(Story.unread).to eq([story]) end it "does not return stories where is_read is true" do create(:story, :read) expect(Story.u...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/user_spec.rb
spec/models/user_spec.rb
# frozen_string_literal: true RSpec.describe User do describe "#update_api_key" do it "updates the api key when the username changed" do user = create(:user, username: "stringer", password: "super-secret") user.update!(username: "booger") expect(user.api_key).to eq(Digest::MD5.hexdigest("booge...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/models/setting/user_signup_spec.rb
spec/models/setting/user_signup_spec.rb
# frozen_string_literal: true RSpec.describe Setting::UserSignup do describe ".first" do it "returns the first record" do setting = described_class.create! expect(described_class.first).to eq(setting) end it "creates a record if one does not already exist" do expect { described_class....
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/utils/feed_discovery_spec.rb
spec/utils/feed_discovery_spec.rb
# frozen_string_literal: true RSpec.describe FeedDiscovery do url = "http://example.com" invalid_discovered_url = "http://not-a-valid-feed.com" valid_discovered_url = "http://a-valid-feed.com" it "returns false if url is not a feed and feed url cannot be discovered" do expect(HTTParty).to receive(:get).wi...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/utils/i18n_support_spec.rb
spec/utils/i18n_support_spec.rb
# frozen_string_literal: true RSpec.describe "i18n", type: :request do it "loads default locale when no locale was set" do allow(UserRepository).to receive(:setup_complete?).and_return(false) ENV["LOCALE"] = nil get "/" expect(I18n.locale.to_s).to eq("en") expect(I18n.locale.to_s).not_to be_nil ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/utils/opml_parser_spec.rb
spec/utils/opml_parser_spec.rb
# frozen_string_literal: true RSpec.describe OpmlParser do it "returns a hash of feed details from an OPML file" do result = described_class.call(<<-XML) <?xml version="1.0" encoding="UTF-8"?> <opml version="1.0"> <head> <title>matt swanson subscriptions in Google Reader</title> <...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/utils/authorization_spec.rb
spec/utils/authorization_spec.rb
# frozen_string_literal: true RSpec.describe Authorization do describe "#check" do it "raises an error if the record belongs to another user" do user = create(:user) feed = create(:feed) expect { described_class.new(user).check(feed) } .to raise_error(Authorization::NotAuthorizedError)...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/utils/content_sanitizer_spec.rb
spec/utils/content_sanitizer_spec.rb
# frozen_string_literal: true RSpec.describe ContentSanitizer do it "handles <wbr> tag properly" do result = described_class.call("<code>WM_<wbr\t\n >ERROR</code> asdf") expect(result).to eq("<code>WM_ERROR</code> asdf") end it "handles <figure> tag properly" do result = described_class.call("<figu...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/lib/admin_constraint_spec.rb
spec/lib/admin_constraint_spec.rb
# frozen_string_literal: true RSpec.describe AdminConstraint do def make_request(session: {}) request = ActionDispatch::Request.new({}) request.session = session request end it "matches when the session user is an admin" do user = create(:user, admin: true) request = make_request(session: { ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/repositories/group_repository_spec.rb
spec/repositories/group_repository_spec.rb
# frozen_string_literal: true RSpec.describe GroupRepository do describe ".list" do it "lists groups ordered by lower name" do group1 = create(:group, name: "Zabba") group2 = create(:group, name: "zlabba") group3 = create(:group, name: "blabba") group4 = create(:group, name: "Babba") ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/repositories/user_repository_spec.rb
spec/repositories/user_repository_spec.rb
# frozen_string_literal: true RSpec.describe UserRepository do describe ".fetch" do it "returns nil when given id is nil" do expect(described_class.fetch(nil)).to be_nil end it "returns the user for the given id" do user = default_user expect(described_class.fetch(user.id)).to eq(user...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/repositories/story_repository_spec.rb
spec/repositories/story_repository_spec.rb
# frozen_string_literal: true RSpec.describe StoryRepository do describe ".add" do def create_feed(url: "http://blog.golang.org/feed.atom") double(url:) end it "normalizes story urls" do feed = create_feed entry = double(url: "//blog.golang.org/context", title: "", content: "") ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false
stringer-rss/stringer
https://github.com/stringer-rss/stringer/blob/9b7a95c9c5b8aaec6ab87359583e3ee49279422c/spec/repositories/feed_repository_spec.rb
spec/repositories/feed_repository_spec.rb
# frozen_string_literal: true RSpec.describe FeedRepository do describe ".fetch" do it "finds and returns found feed" do feed = create(:feed) result = described_class.fetch(feed.id) expect(result).to eq(feed) end end describe ".fetch_by_ids" do it "finds all feeds by id" do ...
ruby
MIT
9b7a95c9c5b8aaec6ab87359583e3ee49279422c
2026-01-04T15:47:22.789280Z
false