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 |
|---|---|---|---|---|---|---|---|---|
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/spec/github-pages/integration_spec.rb | spec/github-pages/integration_spec.rb | # frozen_string_literal: true
RSpec.describe "Pages Gem Integration spec" do
def destination_file(file)
File.join tmp_dir, file
end
def source
@source ||= fixture_dir
end
def destination
@destination ||= tmp_dir
end
def gemfile
"#{source}/Gemfile"
end
def env
{
"BUNDLE_G... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/spec/github-pages/configuration_spec.rb | spec/github-pages/configuration_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe(GitHubPages::Configuration) do
let(:test_config) do
{
"source" => fixture_dir,
"quiet" => true,
"testing" => "123",
"destination" => tmp_dir,
}
end
let(:configuration) { Jekyll.configuration(test_config) }
let(:site) ... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/spec/github-pages/bin_spec.rb | spec/github-pages/bin_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe(GitHubPages) do
it "lists the dependency versions" do
output = `github-pages versions`
expect(output).to include("Gem")
expect(output).to include("Version")
GitHubPages::Dependencies.gems.each do |name, version|
expect(output).to inc... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/spec/github-pages/plugins_spec.rb | spec/github-pages/plugins_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe(GitHubPages::Plugins) do
context "whitelists all default plugins" do
GitHubPages::Plugins::DEFAULT_PLUGINS.each do |plugin|
it "whitelists the #{plugin} plugin" do
expect(GitHubPages::Plugins::PLUGIN_WHITELIST).to include(plugin)
e... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/lib/github-pages.rb | lib/github-pages.rb | # frozen_string_literal: true
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "jekyll"
# Top-level namespace for all GitHub Pages-related concerns.
module GitHubPages
autoload :Plugins, "github-pages/plugins"
autoload :Configuration, "github-pages/configuration"
autoload :Dependencies, "github-pages/d... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/lib/github-pages/plugins.rb | lib/github-pages/plugins.rb | # frozen_string_literal: true
module GitHubPages
# Manages the constants that govern which plugins are allowed on GitHub Pages
class Plugins
# Plugins which are activated by default
DEFAULT_PLUGINS = %w(
jekyll-coffeescript
jekyll-commonmark-ghpages
jekyll-gist
jekyll-github-metadat... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/lib/github-pages/version.rb | lib/github-pages/version.rb | # frozen_string_literal: true
module GitHubPages
VERSION = 232
end
| ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/lib/github-pages/configuration.rb | lib/github-pages/configuration.rb | # frozen_string_literal: true
require "securerandom"
module GitHubPages
# Sets and manages Jekyll configuration defaults and overrides
class Configuration
# Backward compatability of constants
DEFAULT_PLUGINS = GitHubPages::Plugins::DEFAULT_PLUGINS
PLUGIN_WHITELIST = GitHubPages::Plugins::PLUGI... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
github/pages-gem | https://github.com/github/pages-gem/blob/cd7369a21e3ec3f20753012da8e312859dca41a4/lib/github-pages/dependencies.rb | lib/github-pages/dependencies.rb | # frozen_string_literal: true
module GitHubPages
# Dependencies is where all the public dependencies for GitHub Pages are defined,
# and versions locked. Any plugin for Pages must be specified here with a
# corresponding version to which it shall be locked in the runtime dependencies.
class Dependencies
VE... | ruby | MIT | cd7369a21e3ec3f20753012da8e312859dca41a4 | 2026-01-04T16:00:19.865464Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/jobs/shopify_app/script_tags_manager_job.rb | app/jobs/shopify_app/script_tags_manager_job.rb | # frozen_string_literal: true
module ShopifyApp
class ScriptTagsManagerJob < ActiveJob::Base
queue_as do
ShopifyApp.configuration.script_tags_manager_queue_name
end
def perform(shop_domain:, shop_token:, script_tags:)
ShopifyAPI::Auth::Session.temp(shop: shop_domain, access_token: shop_token... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/jobs/shopify_app/webhooks_manager_job.rb | app/jobs/shopify_app/webhooks_manager_job.rb | # frozen_string_literal: true
module ShopifyApp
class WebhooksManagerJob < ActiveJob::Base
queue_as do
ShopifyApp.configuration.webhooks_manager_queue_name
end
def perform(shop_domain:, shop_token:, **)
ShopifyAPI::Auth::Session.temp(shop: shop_domain, access_token: shop_token) do |session|
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/concerns/shopify_app/ensure_installed.rb | app/controllers/concerns/shopify_app/ensure_installed.rb | # frozen_string_literal: true
module ShopifyApp
module EnsureInstalled
extend ActiveSupport::Concern
include ShopifyApp::RedirectForEmbedded
included do
if defined?(ShopifyApp::LoginProtection) && ancestors.include?(ShopifyApp::LoginProtection)
message = <<~EOS
We detected the us... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb | app/controllers/concerns/shopify_app/ensure_authenticated_links.rb | # frozen_string_literal: true
module ShopifyApp
module EnsureAuthenticatedLinks
extend ActiveSupport::Concern
included do
before_action :redirect_to_splash_page, if: :missing_expected_jwt?
end
private
def splash_page
splash_page_with_params(
return_to: request.fullpath,
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb | app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb | # frozen_string_literal: true
module ShopifyApp
module ShopAccessScopesVerification
extend ActiveSupport::Concern
include ShopifyApp::RedirectForEmbedded
included do
# Embedded auth strategy uses Shopify managed install to ensure latest access scopes,
# This will be handled automatically thr... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/concerns/shopify_app/ensure_has_session.rb | app/controllers/concerns/shopify_app/ensure_has_session.rb | # frozen_string_literal: true
module ShopifyApp
module EnsureHasSession
extend ActiveSupport::Concern
included do
include ShopifyApp::Localization
if ShopifyApp.configuration.use_new_embedded_auth_strategy?
include ShopifyApp::TokenExchange
around_action :activate_shopify_sessio... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/shopify_app/authenticated_controller.rb | app/controllers/shopify_app/authenticated_controller.rb | # frozen_string_literal: true
module ShopifyApp
class AuthenticatedController < ActionController::Base
include ShopifyApp::EnsureHasSession
protect_from_forgery with: :exception
end
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/shopify_app/webhooks_controller.rb | app/controllers/shopify_app/webhooks_controller.rb | # frozen_string_literal: true
module ShopifyApp
class WebhooksController < ActionController::Base
include ShopifyApp::WebhookVerification
def receive
params.permit!
ShopifyAPI::Webhooks::Registry.process(
ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.hea... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/shopify_app/extension_verification_controller.rb | app/controllers/shopify_app/extension_verification_controller.rb | # frozen_string_literal: true
module ShopifyApp
class ExtensionVerificationController < ActionController::Base
include ShopifyApp::PayloadVerification
protect_from_forgery with: :null_session
before_action :verify_request
private
def verify_request
unless hmac_valid?(request.raw_post)
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/shopify_app/callback_controller.rb | app/controllers/shopify_app/callback_controller.rb | # frozen_string_literal: true
module ShopifyApp
# Performs login after OAuth completes
class CallbackController < ActionController::Base
include ShopifyApp::LoginProtection
include ShopifyApp::EnsureBilling
def callback
begin
api_session, cookie = validated_auth_objects
rescue => e... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/app/controllers/shopify_app/sessions_controller.rb | app/controllers/shopify_app/sessions_controller.rb | # frozen_string_literal: true
module ShopifyApp
class SessionsController < ActionController::Base
include ShopifyApp::LoginProtection
include ShopifyApp::RedirectForEmbedded
layout false, only: :new
after_action only: [:new, :create, :patch_shopify_id_token] do |controller|
controller.respons... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/test_helper.rb | test/test_helper.rb | # frozen_string_literal: true
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
require "rails/test_help"
require "mocha/minitest"
require "webmock/minitest"
require "byebug"
require "pry-nav"
# Filter out Minitest backtrace while al... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/support/session_store_strategy_test_helpers.rb | test/support/session_store_strategy_test_helpers.rb | # frozen_string_literal: true
module SessionStoreStrategyTestHelpers
class MockShopInstance
# Stub ActiveRecord validation method before including concern
def self.validates(*args); end
include ShopifyApp::ShopSessionStorage
attr_reader :id,
:shopify_domain,
:shopify_token,
:api_v... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/support/generator_test_helpers.rb | test/support/generator_test_helpers.rb | # frozen_string_literal: true
module GeneratorTestHelpers
TEMPLATE_PATH = File.expand_path("../../app_templates", __FILE__)
def provide_existing_gemfile
copy_to_generator_root("", "Gemfile")
end
def provide_existing_application_controller
copy_to_generator_root("app/controllers", "application_control... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/support/access_scopes_strategy_test_helpers.rb | test/support/access_scopes_strategy_test_helpers.rb | # frozen_string_literal: true
module AccessScopesStrategyHelpers
def mock_shop_scopes_mismatch_strategy
ShopifyApp::AccessScopes::ShopStrategy.stubs(:update_access_scopes?).returns(true)
end
def mock_shop_scopes_match_strategy
ShopifyApp::AccessScopes::ShopStrategy.stubs(:update_access_scopes?).returns(... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/integration/webhooks_controller_test.rb | test/integration/webhooks_controller_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class OrderUpdateJob < ActiveJob::Base
include ShopifyAPI::Webhooks::WebhookHandler
class << self
def handle(topic:, shop:, body:, webhook_id:, api_version:)
perform_later(topic: topic, shop_domain: shop, webhook: body)
end
end
de... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/sessions_controller_test.rb | test/controllers/sessions_controller_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
module Shopify
class AfterAuthenticateJob < ActiveJob::Base
def perform; end
end
end
module ShopifyApp
APP_API_KEY = "my_app_api_key"
class SessionsControllerTest < ActionController::TestCase
setup do
@routes = ShopifyApp::Engine.r... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/callback_controller_test.rb | test/controllers/callback_controller_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
module Shopify
class AfterAuthenticateJob < ActiveJob::Base
def perform; end
end
class CustomPostAuthenticateTasks
class << self
def perform(session)
end
end
end
end
class CartsUpdateJob < ActiveJob::Base
include Shopi... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/extension_verification_controller_test.rb | test/controllers/extension_verification_controller_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class ExtensionController < ShopifyApp::ExtensionVerificationController
def extension_action
head(:ok)
end
end
class ExtensionVerificationControllerTest < ActionController::TestCase
tests ExtensionController
setup do
ShopifyApp.configur... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/ensure_has_session_test.rb | test/controllers/concerns/ensure_has_session_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class EnsureHasSessionTest < ActionController::TestCase
test "includes all the needed concerns" do
ShopifyApp.configuration.stubs(:use_new_embedded_auth_strategy?).returns(false)
controller = define_controller
assert_common_concerns_are... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/embedded_app_test.rb | test/controllers/concerns/embedded_app_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_view/testing/resolvers"
class EmbeddedAppTest < ActionDispatch::IntegrationTest
class BaseTestController < ActionController::Base
abstract!
self.view_paths = [
ActionView::FixtureResolver.new(
"layouts/applicat... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/ensure_billing_test.rb | test/controllers/concerns/ensure_billing_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_controller"
require "action_controller/base"
class EnsureBillingTest < ActionController::TestCase
class BillingTestController < ActionController::Base
include ShopifyApp::LoginProtection
include ShopifyApp::EnsureBilling
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/ensure_installed_test.rb | test/controllers/concerns/ensure_installed_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class EnsureInstalledTest < ActionController::TestCase
class UnauthenticatedTestController < ActionController::Base
include ShopifyApp::EnsureInstalled
def index
render(html: "<h1>Success</ h1>")
end
end
tests Unauthenticated... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/ensure_authenticated_links_test.rb | test/controllers/concerns/ensure_authenticated_links_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class EnsureAuthenticatedLinksTest < ActionController::TestCase
class TurbolinksTestController < ActionController::Base
include ShopifyApp::EnsureAuthenticatedLinks
def root
render(html: "<h1>Splash Page</ h1>")
end
def some_... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/controllers/concerns/shop_access_scopes_verification_test.rb | test/controllers/concerns/shop_access_scopes_verification_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ScopesVerificationController < ActionController::Base
include ShopifyApp::ShopAccessScopesVerification
def index
render(plain: "OK")
end
end
class ShopAccessScopesVerificationControllertest < ActionController::TestCase
tests Scopes... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/routes/webhooks_routes_test.rb | test/routes/webhooks_routes_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class WebhooksRoutingTest < ActionController::TestCase
setup do
@routes = ShopifyApp::Engine.routes
end
test "webhooks routing" do
assert_routing(
{ method: "post", path: "webhooks/test" },
{ controller: "shopify_app/webhooks",... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/routes/callback_routes_test.rb | test/routes/callback_routes_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class CallbackRoutesTest < ActionController::TestCase
setup do
@routes = ShopifyApp::Engine.routes
ShopifyApp::SessionRepository.shop_storage = ShopifyApp::InMemoryShopSessionStore
ShopifyApp.configuration = nil
end
teardown do
Sho... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/routes/sessions_routes_test.rb | test/routes/sessions_routes_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class SessionsRoutesTest < ActionController::TestCase
setup do
@routes = ShopifyApp::Engine.routes
ShopifyApp::SessionRepository.shop_storage = ShopifyApp::InMemoryShopSessionStore
ShopifyApp.configuration = nil
end
teardown do
Sho... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/app/controllers/application_controller.rb | test/app_templates/app/controllers/application_controller.rb | # frozen_string_literal: true
class ApplicationController < ActionController::Base
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/config/application.rb | test/app_templates/config/application.rb | # frozen_string_literal: true
require File.expand_path("../boot", __FILE__)
require "rails/all"
Bundler.require(*Rails.groups)
module AppTemplate
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/config/routes.rb | test/app_templates/config/routes.rb | # frozen_string_literal: true
Rails.application.routes.draw do
scope path: :api, format: :json do
# POST /api/products and GET /api/products/count
resources :products, only: :create do
collection do
get :count
end
end
namespace :webhooks do
post "/app_uninstalled", to: "app_... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/config/initializers/shopify_app.rb | test/app_templates/config/initializers/shopify_app.rb | # frozen_string_literal: true
ShopifyApp.configure do |config|
config.application_name = "name"
config.api_key = ENV["SHOPIFY_API_KEY"]
config.secret = ENV["SHOPIFY_API_SECRET"]
config.scope = "read_orders read_products"
config.embedded_app = true
config.shop_session_repository = "ShopifyApp::InMemoryShopS... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/config/initializers/shopify_app_with_webhooks.rb | test/app_templates/config/initializers/shopify_app_with_webhooks.rb | # frozen_string_literal: true
ShopifyApp.configure do |config|
config.api_key = "key"
config.secret = "secret"
config.scope = "read_orders, read_products"
config.embedded_app = true
config.webhooks = [
{ topic: "carts/update", path: "webhooks/carts_update" },
]
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/app_templates/config/environments/development.rb | test/app_templates/config/environments/development.rb | # frozen_string_literal: true
Rails.application.configure do
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/products_controller_generator_with_execution_test.rb | test/generators/products_controller_generator_with_execution_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../utils/rails_generator_runtime"
require_relative "../../lib/generators/shopify_app/products_controller/products_controller_generator"
require_relative "../../lib/generators/shopify_app/authenticated_controller/authenticated_controller_... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/add_webhook_generator_test.rb | test/generators/add_webhook_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/add_webhook/add_webhook_generator"
class AddWebhookGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AddWebhookGenerator
destination File.expand_path("../tmp", File.dirname(__... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/products_controller_generator_test.rb | test/generators/products_controller_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/products_controller/products_controller_generator"
class ProductsControllerGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::ProductsControllerGenerator
destination File.expan... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/install_generator_test.rb | test/generators/install_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/install/install_generator"
class InstallGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::InstallGenerator
destination File.expand_path("../tmp", File.dirname(__FILE__))
se... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/shop_model_generator_test.rb | test/generators/shop_model_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/shop_model/shop_model_generator"
class ShopModelGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::ShopModelGenerator
destination File.expand_path("../tmp", File.dirname(__FILE... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/app_proxy_controller_generator_test.rb | test/generators/app_proxy_controller_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator"
class AppProxyControllerGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AppProxyControllerGenerator
destination File.exp... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/add_declarative_webhook_generator_test.rb | test/generators/add_declarative_webhook_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/add_declarative_webhook/add_declarative_webhook_generator"
class AddDeclarativeWebhookGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AddDeclarativeWebhookGenerator
destinat... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/add_privacy_jobs_generator_job_test.rb | test/generators/add_privacy_jobs_generator_job_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/add_privacy_jobs/add_privacy_jobs_generator"
class AddPrivacyJobsGeneratorJobTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AddPrivacyJobsGenerator
destination File.expand_path("../... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/views_generator_test.rb | test/generators/views_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/views/views_generator"
class ViewsGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::ViewsGenerator
destination File.expand_path("../tmp", File.dirname(__FILE__))
setup :prep... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/add_after_authenticate_job_generator_test.rb | test/generators/add_after_authenticate_job_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator"
class AddAfterAuthenticateJobGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AddAfterAuthenticateJobGenerator
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/controllers_generator_test.rb | test/generators/controllers_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/controllers/controllers_generator"
class ControllersGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::ControllersGenerator
destination File.expand_path("../tmp", File.dirname(... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/home_controller_generator_test.rb | test/generators/home_controller_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/home_controller/home_controller_generator"
class HomeControllerGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::HomeControllerGenerator
destination File.expand_path("../tmp",... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/add_app_uninstalled_job_generator_test.rb | test/generators/add_app_uninstalled_job_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/add_app_uninstalled_job/add_app_uninstalled_job_generator"
class AddAppUninstalledJobGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::AddAppUninstalledJobGenerator
destinatio... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/rotate_shopify_token_job_generator_test.rb | test/generators/rotate_shopify_token_job_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator"
class RotateShopifyTokenJobGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::RotateShopifyTokenJobGenerator
destin... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/home_controller_generator_with_execution_test.rb | test/generators/home_controller_generator_with_execution_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../utils/rails_generator_runtime"
require_relative "../../lib/generators/shopify_app/home_controller/home_controller_generator"
require_relative "../../lib/generators/shopify_app/authenticated_controller/authenticated_controller_generato... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/user_model_generator_test.rb | test/generators/user_model_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/user_model/user_model_generator"
class UserModelGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::UserModelGenerator
destination File.expand_path("../tmp", File.dirname(__FILE... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/shopify_app_generator.rb | test/generators/shopify_app_generator.rb | # frozen_string_literal: true
require "test_helper"
require_relative "../../lib/generators/shopify_app/shopify_app_generator"
class ShopifyAppGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::ShopifyAppGenerator
destination File.expand_path("../tmp", File.dirname(__FILE__))
setup do
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/generators/routes_generator_test.rb | test/generators/routes_generator_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../../lib/generators/shopify_app/routes/routes_generator"
class ControllerGeneratorTest < Rails::Generators::TestCase
tests ShopifyApp::Generators::RoutesGenerator
destination File.expand_path("../tmp", File.dirname(__FILE__))
se... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/csp_helper_test.rb | test/shopify_app/csp_helper_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class CspHelperTest < ActiveSupport::TestCase
setup do
@policy = ActionDispatch::ContentSecurityPolicy.new
end
test "adds App Bridge script source to empty policy" do
ShopifyApp.add_csp_directives(@policy)
script_src = @policy.directi... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/utils_test.rb | test/shopify_app/utils_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
class UtilsTest < ActiveSupport::TestCase
setup do
ShopifyApp.configuration.stubs(:myshopify_domain).returns("myshopify.com")
end
[
"my-shop",
"my-shop.myshopify.com",
"https://my-shop.myshopify.com",
"http://my-shop.myshopify.... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/configuration_test.rb | test/shopify_app/configuration_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
module Shopify
class CustomPostAuthenticateTasks
def self.perform
end
end
class InvalidPostAuthenticateTasksClass
def self.not_perform
end
end
end
class ConfigurationTest < ActiveSupport::TestCase
setup do
ShopifyApp.confi... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/auth/post_authenticate_tasks_test.rb | test/shopify_app/auth/post_authenticate_tasks_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module Shopify
class AfterAuthenticateJob < ActiveJob::Base
def perform; end
end
end
class CartsUpdateJob < ActiveJob::Base
include ShopifyAPI::Webhooks::WebhookHandler
class << self
def handle(topic:, shop:, body:, webhook_id:, api_... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/auth/token_exchange_test.rb | test/shopify_app/auth/token_exchange_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ShopifyApp::Auth::TokenExchangeTest < ActiveSupport::TestCase
OFFLINE_ACCESS_TOKEN_TYPE = ShopifyAPI::Auth::TokenExchange::RequestedTokenType::OFFLINE_ACCESS_TOKEN
ONLINE_ACCESS_TOKEN_TYPE = ShopifyAPI::Auth::TokenExchange::RequestedTokenTyp... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/admin_api/with_token_refetch_test.rb | test/shopify_app/admin_api/with_token_refetch_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ShopifyApp::AdminAPI::WithTokenRefetchTest < ActiveSupport::TestCase
include ShopifyApp::AdminAPI::WithTokenRefetch
def setup
@session = ShopifyAPI::Auth::Session.new(id: "session-id", shop: "shop", access_token: "old", expires: 1.hour.... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/login_protection_test.rb | test/shopify_app/controller_concerns/login_protection_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_controller"
require "action_controller/base"
require "action_view/testing/resolvers"
class LoginProtectionController < ActionController::Base
include ShopifyApp::EmbeddedApp
include ShopifyApp::LoginProtection
helper_method :curr... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/csrf_protection_test.rb | test/shopify_app/controller_concerns/csrf_protection_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class CsrfProtectionController < ActionController::Base
include ShopifyApp::LoginProtection
include ShopifyApp::CsrfProtection
def authenticity_token
render(json: { authenticity_token: form_authenticity_token })
end
def csrf_test
h... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/localization_test.rb | test/shopify_app/controller_concerns/localization_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_controller"
require "action_controller/base"
class LocalizationController < ActionController::Base
include ShopifyApp::Localization
def index
render(plain: I18n.locale)
end
end
class LocalizationTest < ActionController::Tes... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/token_exchange_test.rb | test/shopify_app/controller_concerns/token_exchange_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_controller"
require "action_controller/base"
require "json"
class ApiClass
def self.perform; end
end
class TokenExchangeController < ActionController::Base
include ShopifyApp::TokenExchange
around_action :activate_shopify_sessi... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/webhook_verification_test.rb | test/shopify_app/controller_concerns/webhook_verification_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "action_controller"
require "action_controller/base"
class WebhookVerificationController < ActionController::Base
self.allow_forgery_protection = true
protect_from_forgery with: :exception
include ShopifyApp::WebhookVerification
def ... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/with_shopify_id_token_test.rb | test/shopify_app/controller_concerns/with_shopify_id_token_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class WithShopifyIdTokenController < ActionController::Base
include ShopifyApp::WithShopifyIdToken
def index
render(plain: "index")
end
end
class WithShopifyIdTokenTest < ActionController::TestCase
tests WithShopifyIdTokenController
d... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/controller_concerns/app_proxy_verification_test.rb | test/shopify_app/controller_concerns/app_proxy_verification_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class AppProxyVerificationController < ActionController::Base
self.allow_forgery_protection = true
protect_from_forgery with: :exception
include ShopifyApp::AppProxyVerification
def basic
head(:ok)
end
end
class AppProxyVerificationTe... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/access_scopes/shop_strategy_test.rb | test/shopify_app/access_scopes/shop_strategy_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
module AccessScopes
class ShopStrategyTest < Minitest::Test
attr_reader :shopify_domain
def setup
@shopify_domain = "shop.myshopify.com"
end
def test_scopes_dont_mismatch_if_configuration_and_s... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/access_scopes/noop_strategy_test.rb | test/shopify_app/access_scopes/noop_strategy_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
module AccessScopes
class NoopStrategyTest < Minitest::Test
attr_reader :shopify_domain
attr_reader :user_id
attr_reader :shopify_user_id
def setup
@shopify_domain = "shop.myshopify.com"
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/access_scopes/user_strategy_test.rb | test/shopify_app/access_scopes/user_strategy_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
module AccessScopes
class UserStrategyTest < Minitest::Test
attr_reader :user_id
attr_reader :shopify_user_id
attr_reader :shopify_domain
def setup
@user_id = 1
@shopify_user_id = 2
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/managers/webhooks_manager_test.rb | test/shopify_app/managers/webhooks_manager_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class OrdersUpdatedJob < ActiveJob::Base
include ShopifyAPI::Webhooks::WebhookHandler
class << self
def handle(topic:, shop:, body:, webhook_id:, api_version:)
perform_later(topic: topic, shop_domain: shop, webhook: body)
end
end
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/managers/script_tags_manager_test.rb | test/shopify_app/managers/script_tags_manager_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ShopifyApp::ScriptTagsManagerTest < ActiveSupport::TestCase
include ActiveJob::TestHelper
setup do
@script_tags = [
{ cache: true, src: "https://example-app.com/fancy.js" },
{ cache: true, src: "https://example-app.com/fooba... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/shop_session_storage_with_scopes_test.rb | test/shopify_app/session/shop_session_storage_with_scopes_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ShopMockSessionStoreWithScopes < ActiveRecord::Base
include ShopifyApp::ShopSessionStorageWithScopes
end
module ShopifyApp
class ShopSessionStorageWithScopesTest < ActiveSupport::TestCase
TEST_SHOPIFY_DOMAIN = "example.myshopify.com"
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/user_session_storage_with_scopes_test.rb | test/shopify_app/session/user_session_storage_with_scopes_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class UserMockSessionStoreWithScopes < ActiveRecord::Base
include ShopifyApp::UserSessionStorageWithScopes
end
module ShopifyApp
class UserSessionStorageWithScopesTest < ActiveSupport::TestCase
TEST_SHOPIFY_USER_ID = 42
TEST_SHOPIFY_DOMAI... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/in_memory_user_session_store_test.rb | test/shopify_app/session/in_memory_user_session_store_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
class InMemoryUserSessionStoreTest < ActiveSupport::TestCase
teardown do
InMemoryUserSessionStore.clear
end
test "retrieving a session by JWT" do
InMemoryUserSessionStore.repo["abra"] = "something"
u... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/in_memory_session_store_test.rb | test/shopify_app/session/in_memory_session_store_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
class InMemorySessionStoreTest < ActiveSupport::TestCase
teardown do
InMemorySessionStore.clear
end
test "storing a session" do
uuid = InMemorySessionStore.store("something")
assert_equal "something",... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/shop_session_storage_test.rb | test/shopify_app/session/shop_session_storage_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class ShopMockSessionStore < ActiveRecord::Base
include ShopifyApp::ShopSessionStorage
end
module ShopifyApp
class ShopSessionStorageTest < ActiveSupport::TestCase
TEST_SHOPIFY_DOMAIN = "example.myshopify.com"
TEST_SHOPIFY_TOKEN = "123456... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/user_session_storage_test.rb | test/shopify_app/session/user_session_storage_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
class UserMockSessionStore < ActiveRecord::Base
include ShopifyApp::UserSessionStorage
end
module ShopifyApp
class UserSessionStorageTest < ActiveSupport::TestCase
TEST_SHOPIFY_USER_ID = 42
TEST_SHOPIFY_DOMAIN = "example.myshopify.com"
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/in_memory_shop_session_store_test.rb | test/shopify_app/session/in_memory_shop_session_store_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
class InMemoryShopSessionStoreTest < ActiveSupport::TestCase
teardown do
InMemoryShopSessionStore.clear
end
test "retrieving a session by JWT" do
InMemoryShopSessionStore.repo["abra"] = "something"
s... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/session_storage_test.rb | test/shopify_app/session/session_storage_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module Shopify
class SessionStorageTest < ActiveSupport::TestCase
TEST_SHOPIFY_DOMAIN = "example.myshopify.com"
TEST_SHOPIFY_TOKEN = "1234567890abcdef"
test "#with_shopify_session should be supplied ShopifyAPI::Auth::Session in block ar... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/session_repository_test.rb | test/shopify_app/session/session_repository_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require_relative "../../../lib/generators/shopify_app/shop_model/templates/shop.rb"
require_relative "../../../lib/generators/shopify_app/user_model/templates/user.rb"
module ShopifyApp
class SessionRepositoryTest < ActiveSupport::TestCase
teard... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/session/null_user_session_store_test.rb | test/shopify_app/session/null_user_session_store_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
module ShopifyApp
class NullUserSessionStoreTest < ActiveSupport::TestCase
test ".retrieve returns nil" do
assert_nil NullUserSessionStore.retrieve("payload")
end
test ".store raises ConfigurationError" do
assert_raises(::Sh... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/shopify_app/test_helpers/shopify_session_helper_test.rb | test/shopify_app/test_helpers/shopify_session_helper_test.rb | # frozen_string_literal: true
require_relative "../../test_helper"
require "shopify_app/test_helpers/shopify_session_helper"
class ShopifySessionHelpersController < ActionController::Base
include ShopifyApp::EmbeddedApp
include ShopifyApp::LoginProtection
around_action :activate_shopify_session, only: [:index]
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/utils/rails_generator_runtime.rb | test/utils/rails_generator_runtime.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "../test_helpers/fake_session_storage"
module Utils
class RailsGeneratorRuntime
ROOT = "test/.generated"
def initialize(test_class)
raise "Caller must provide an instance of a test to Utils::RailsGeneratorRuntime.new" if... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/utils/rails_generator_runtime_test.rb | test/utils/rails_generator_runtime_test.rb | # frozen_string_literal: true
require_relative "../test_helper"
require_relative "rails_generator_runtime"
require_relative "../../lib/generators/shopify_app/home_controller/home_controller_generator"
module Utils
class RailsGeneratorRuntimeTest < ActiveSupport::TestCase
test "generates and clears classes" do
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/app/controllers/dummy_home_controller.rb | test/dummy/app/controllers/dummy_home_controller.rb | # frozen_string_literal: true
class DummyHomeController < ApplicationController
include ShopifyApp::EmbeddedApp
include ShopifyApp::EnsureInstalled
def index
"index"
end
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/app/controllers/application_controller.rb | test/dummy/app/controllers/application_controller.rb | # frozen_string_literal: true
class ApplicationController < ActionController::Base
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/application.rb | test/dummy/config/application.rb | # frozen_string_literal: true
require File.expand_path("../boot", __FILE__)
require "rails/all"
require "sprockets/railtie"
Bundler.require(*Rails.groups)
require "shopify_app"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/environment.rb | test/dummy/config/environment.rb | # frozen_string_literal: true
# Load the Rails application.
require File.expand_path("../application", __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/routes.rb | test/dummy/config/routes.rb | # frozen_string_literal: true
Rails.application.routes.draw do
mount ShopifyApp::Engine, at: "/"
root to: "dummy_home#index"
end
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/boot.rb | test/dummy/config/boot.rb | # frozen_string_literal: true
# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../../Gemfile", __FILE__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift(File.expand_path("../../../../lib", __FILE__))
| ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/initializers/shopify_app.rb | test/dummy/config/initializers/shopify_app.rb | # frozen_string_literal: true
class ShopifyAppConfigurer
def self.call
ShopifyApp.configure do |config|
config.api_key = "key"
config.old_secret = nil
config.secret = "secret"
config.scope = "read_orders, read_products"
config.shop_access_scopes = nil
config.user_access_scopes... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Shopify/shopify_app | https://github.com/Shopify/shopify_app/blob/e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "s... | ruby | MIT | e7ae8e548a0232c2fa1801cf0c4f15d8242dd22b | 2026-01-04T16:00:17.637053Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.