Merge branch 'main' into fizzy-do-prompts
* main: (57 commits) Untenanted access in authenticated controllers should request auth dep: bundle update dep: update Rails dep: bump AR::Tenanted Clean up the cable meta tag Fix activity feed pagination to fetch on demand Create a "published" event if a card is created published Scatter Honcho seeds over a 30 day period Fix the PWA manifest to use slugged URLs Collection publication edits render a turbo frame Collection workflow edits render a turbo frame Collection entropy config edits render a turbo frame Use automatic sizing where supported Introduce a separate controller for collection entropy config Add `card_id` to index Move to scope and inline method Prefer modern syntax Fix that stage should be visible above card background Indicate opens menu Hide dialog targets from screen readers when closed ... # Conflicts: # db/schema.rb # db/schema_cache.yml
This commit is contained in:
@@ -123,10 +123,10 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "visit screens" do
|
||||
assert_command({ commands: [ "/visit #{user_path(@user)}" ] }, "my profile")
|
||||
assert_command({ commands: [ "/visit #{edit_user_path(@user)}" ] }, "edit my profile")
|
||||
assert_command({ commands: [ "/visit #{account_settings_path}" ] }, "manage users")
|
||||
assert_command({ commands: [ "/visit #{account_settings_path}" ] }, "account settings")
|
||||
assert_command({ commands: [ "/visit #{user_path(@user, script_name: nil)}" ] }, "my profile")
|
||||
assert_command({ commands: [ "/visit #{edit_user_path(@user, script_name: nil)}" ] }, "edit my profile")
|
||||
assert_command({ commands: [ "/visit #{account_settings_path(script_name: nil)}" ] }, "manage users")
|
||||
assert_command({ commands: [ "/visit #{account_settings_path(script_name: nil)}" ] }, "account settings")
|
||||
end
|
||||
|
||||
test "create cards" do
|
||||
@@ -165,7 +165,7 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
|
||||
def translate(query, user: @user, context: :list)
|
||||
raise "Context must be :card or _list" unless context.in?(%i[ card list ])
|
||||
url = context == :card ? card_url(cards(:logo)) : cards_url
|
||||
context = Command::Parser::Context.new(user, url: url)
|
||||
context = Command::Parser::Context.new(user, url: url, script_name: integration_session.default_url_options[:script_name])
|
||||
translator = Command::Ai::Translator.new(context)
|
||||
translator.translate(query)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
require "test_helper"
|
||||
|
||||
class Command::VisitUrlTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@user = users(:david)
|
||||
@card = cards(:logo)
|
||||
@script_name = integration_session.default_url_options[:script_name]
|
||||
end
|
||||
|
||||
test "visit a path without the account slug" do
|
||||
result = visit_command("/foo/1234/bar").execute
|
||||
|
||||
assert_kind_of Command::Result::Redirection, result
|
||||
assert_equal "#{@script_name}/foo/1234/bar", result.url
|
||||
end
|
||||
|
||||
test "visit a path with the account slug" do
|
||||
result = visit_command("#{@script_name}/foo/1234/bar").execute
|
||||
|
||||
assert_kind_of Command::Result::Redirection, result
|
||||
assert_equal "#{@script_name}/foo/1234/bar", result.url
|
||||
end
|
||||
|
||||
test "visit an object path" do
|
||||
result = visit_command(@card).execute
|
||||
|
||||
assert_kind_of Command::Result::Redirection, result
|
||||
assert_equal @card, result.url
|
||||
end
|
||||
|
||||
private
|
||||
def visit_command(url)
|
||||
context = Command::Parser::Context.new(@user, url: collection_card_url(@card.collection, @card), script_name: integration_session.default_url_options[:script_name])
|
||||
Command::VisitUrl.new(url: url, context: context)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user