WIP Add wallet transactions route, view
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Adds a new component for the wallet summary as well, and makes the component tests work with RSpec.
This commit is contained in:
11
spec/components/wallet_summary_component_spec.rb
Normal file
11
spec/components/wallet_summary_component_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe WalletSummaryComponent, type: :component do
|
||||
it "renders the balance as a human-readable number" do
|
||||
expect(
|
||||
render_inline(described_class.new(balance: 2301000)) {}.css("section").to_html
|
||||
).to include(
|
||||
"2,301,000 sats"
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -10,6 +10,8 @@ require 'capybara'
|
||||
require 'devise'
|
||||
require 'support/controller_macros'
|
||||
require 'support/database_cleaner'
|
||||
require "view_component/test_helpers"
|
||||
require "capybara/rspec"
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc, in
|
||||
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
||||
@@ -70,5 +72,8 @@ RSpec.configure do |config|
|
||||
config.include Warden::Test::Helpers
|
||||
config.include FactoryBot::Syntax::Methods
|
||||
config.include ActiveJob::TestHelper, type: :job
|
||||
config.include ViewComponent::TestHelpers, type: :component
|
||||
config.include Capybara::RSpecMatchers, type: :component
|
||||
|
||||
config.extend ControllerMacros, :type => :controller
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user