Skip to content

Commit 853be1d

Browse files
authored
Release v0.5.2 (#50)
* feat: add the bb_schema dump to the GraphQL client * test: avoid flaky tests for the GraphQL client * chore: bump version
1 parent fdaee40 commit 853be1d

File tree

6 files changed

+10
-24
lines changed

6 files changed

+10
-24
lines changed

decidim-bulletin_board-ruby/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.2] - 2020-12-20
9+
10+
### Fixed
11+
12+
- Include the schema definition within the gem to avoid extra trips to the server
13+
814
## [0.5.1] - 2020-12-19
915

1016
### Fixed

decidim-bulletin_board-ruby/lib/decidim/bulletin_board/graphql/client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Graphql
77
class Client
88
def self.client
99
@client ||= Graphlient::Client.new(BulletinBoard.server,
10+
schema_path: "lib/decidim/bulletin_board/graphql/bb_schema.json",
1011
headers: {
1112
"Authorization" => BulletinBoard.api_key
1213
})

decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Decidim
44
module BulletinBoard
5-
VERSION = "0.5.1"
5+
VERSION = "0.5.2"
66
end
77
end

decidim-bulletin_board-ruby/spec/decidim/bulletin_board/graphql/client_spec.rb

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,6 @@ module Graphql
88
describe Client do
99
subject { described_class.client }
1010

11-
let(:server) { "https://bb.example.org" }
12-
let(:api_key) { "IUdVVU0OF2qZgYIeJQnQHZPRloOh4srmXFZPPQx7" }
13-
let(:client_url) { subject.instance_variable_get(:@url) }
14-
let(:client_options) { subject.instance_variable_get(:@options) }
15-
16-
before do
17-
# Decidim::BulletinBoard::Graphql::Client.class_variable_set(@client, nil)
18-
Decidim::BulletinBoard.configure do |config|
19-
config.server = server
20-
config.api_key = api_key
21-
end
22-
end
23-
2411
it "has a client" do
2512
expect(subject).not_to be_nil
2613
end
@@ -29,12 +16,8 @@ module Graphql
2916
expect(subject).to be_a Graphlient::Client
3017
end
3118

32-
it "uses Bulletin board server as url" do
33-
expect(server).to eql(client_url)
34-
end
35-
36-
it "uses Bulletin board api key as authorization" do
37-
expect(api_key).to eql(client_options[:headers]["Authorization"])
19+
it "has a schema" do
20+
expect(subject.schema).to be_a Graphlient::Schema
3821
end
3922
end
4023
end

decidim-bulletin_board-ruby/spec/shared/client_context.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
config.identification_private_key = identification_private_key
1212
end
1313

14-
allow(Decidim::BulletinBoard::Graphql::Client).to receive(:client).and_return(
15-
Graphlient::Client.new(server, schema_path: "spec/fixtures/bb_schema.json")
16-
)
17-
1814
if server.present?
1915
if error_response
2016
stub_request(:post, server).to_return(status: 500)

0 commit comments

Comments
 (0)