-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Domain < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CreateDomains < ActiveRecord::Migration[7.2] | ||
def change | ||
create_table :domains do |t| | ||
t.string :handle | ||
t.string :fullname | ||
t.string :item_type | ||
t.integer :item_id | ||
t.timestamps | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,25 @@ | |
|
||
class Api::ProfileControllerTest < ActionDispatch::IntegrationTest | ||
|
||
# test "api#profile/signin_with_email" do | ||
# post api_service_send_email_url, params: { context: "email-signin", email: "[email protected]" } | ||
# assert_response :success | ||
# p response.body | ||
test "api#profile/signin_with_email" do | ||
post api_service_send_email_url, params: { context: "email-signin", email: "[email protected]" } | ||
assert_response :success | ||
|
||
# post api_profile_signin_with_email_url, params: { email: "[email protected]", code: ProfileToken.last.code } | ||
# assert_response :success | ||
# p response.body | ||
# auth_token = JSON.parse(response.body)["auth_token"] | ||
# p Profile.find_by(email: "[email protected]") | ||
post api_profile_signin_with_email_url, params: { email: "[email protected]", code: ProfileToken.last.code } | ||
assert_response :success | ||
auth_token = JSON.parse(response.body)["auth_token"] | ||
assert Profile.find_by(email: "[email protected]") | ||
|
||
# post api_profile_create_url, params: { auth_token: auth_token, handle: "example" } | ||
# assert_response :success | ||
# p response.body | ||
post api_profile_create_url, params: { auth_token: auth_token, handle: "example" } | ||
assert_response :success | ||
assert Domain.find_by(handle: "example", item_type: "Profile", item_id: Profile.find_by(handle: "example").id).present? | ||
|
||
# get api_profile_get_by_email_url, params: { email: "[email protected]" } | ||
# assert_response :success | ||
# p response.body | ||
get api_profile_get_by_email_url, params: { email: "[email protected]" } | ||
assert_response :success | ||
|
||
# get api_profile_me_url, params: { auth_token: auth_token } | ||
# assert_response :success | ||
# end | ||
get api_profile_me_url, params: { auth_token: auth_token } | ||
assert_response :success | ||
end | ||
|
||
# test "api#profile/set_verified_email" do | ||
# post api_service_send_email_url, params: { context: "email-verify", email: "[email protected]" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
require "test_helper" | ||
|
||
class Api::VoucherControllerTest < ActionDispatch::IntegrationTest | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
# generate test for voucher/create | ||
test "api#voucher/create" do | ||
profile = Profile.find_by(handle: "cookie") | ||
auth_token = profile.gen_auth_token | ||
|
||
post api_voucher_create_url, params: { auth_token: auth_token, voucher: { | ||
code: "VOUCHER123", | ||
description: "Voucher for 123", | ||
} } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | ||
|
||
# This model initially had no columns defined. If you add columns to the | ||
# model remove the "{}" from the fixture names and add the columns immediately | ||
# below each fixture, per the syntax in the comments below | ||
# | ||
# one: {} | ||
# column: value | ||
# | ||
# two: {} | ||
# column: value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class DomainTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |