Skip to content

Commit

Permalink
update Ruby version + fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Adeynack committed Oct 22, 2024
1 parent d8b1ec3 commit db217a7
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.3.4
FROM ruby:3.3.5

WORKDIR /workspaces/${LOCAL_WORKSPACE_FOLDER_BASENAME}

Expand Down
10 changes: 1 addition & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@
"cweijan.vscode-database-client2",
"DrMerfy.overtype",
"apollographql.vscode-apollo"
],
"settings": {
"typescript.tsdk": "node_modules/typescript/lib",
"rubyLsp.rubyVersionManager": "none",
"[ruby]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "Shopify.ruby-lsp"
}
}
]
}
}
}
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 3.3.2
TargetRubyVersion: 3.3.5
DisplayCopNames: true
DisplayStyleGuide: true
NewCops: disable
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.4
3.3.5
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[ruby]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "Shopify.ruby-lsp"
}
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.3.2
ARG RUBY_VERSION=3.3.5
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base

# Rails app lives here
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/core/MenuBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Menu } from "antd";
import React, { useContext } from "react";
import React from "react";
import {
AccountBookOutlined,
BookOutlined,
FolderOutlined,
UserOutlined,
} from "@ant-design/icons";
import { Link, useLocation, useParams } from "react-router-dom";
import { SessionContext, useSession } from "../../models/session";
import { useSession } from "../../models/session";
import { ItemType, MenuItemType } from "antd/es/menu/interface";
import {
bookAccountsPath,
Expand Down
6 changes: 2 additions & 4 deletions spec/graphql/queries/books_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
}
GQL
end
let(:queried_books) do
gql_data(query:).dig("books", "nodes")
end
let(:queried_books) { gql_data(query:).dig("books", "nodes") }

before do
login!(user:) if user
Expand All @@ -28,7 +26,7 @@
let(:user) { nil }

it "returns no book" do
expect(queried_books).to be_empty
expect(gql_errors(query:).sole["message"]).to eq FinancesSchema::NOT_FOUND_OR_NOT_AUTHORIZED_ERROR_MESSAGE
end
end

Expand Down
6 changes: 6 additions & 0 deletions spec/support/graphql_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def gql_data(query:, variables: nil)
raise "GraphQL Errors: #{JSON.pretty_generate(result["errors"])}" if result["errors"].present?
result.fetch("data")
end

def gql_errors(query:, variables: nil)
errors = gql(query:, variables:)["errors"]
raise "GraphQL did not return errors as expected" unless errors.present?
errors
end
end

RSpec.configure do |config|
Expand Down

0 comments on commit db217a7

Please sign in to comment.