File tree Expand file tree Collapse file tree 6 files changed +10
-24
lines changed
decidim-bulletin_board-ruby
lib/decidim/bulletin_board
decidim/bulletin_board/graphql Expand file tree Collapse file tree 6 files changed +10
-24
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and 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
File renamed without changes.
Original file line number Diff line number Diff 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 } )
Original file line number Diff line number Diff line change 22
33module Decidim
44 module BulletinBoard
5- VERSION = "0.5.1 "
5+ VERSION = "0.5.2 "
66 end
77end
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments