Skip to content

Commit

Permalink
Release v0.5.2 (#50)
Browse files Browse the repository at this point in the history
* feat: add the bb_schema dump to the GraphQL client

* test: avoid flaky tests for the GraphQL client

* chore: bump version
  • Loading branch information
leio10 authored Dec 20, 2020
1 parent fdaee40 commit 853be1d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 24 deletions.
6 changes: 6 additions & 0 deletions decidim-bulletin_board-ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.2] - 2020-12-20

### Fixed

- Include the schema definition within the gem to avoid extra trips to the server

## [0.5.1] - 2020-12-19

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Graphql
class Client
def self.client
@client ||= Graphlient::Client.new(BulletinBoard.server,
schema_path: "lib/decidim/bulletin_board/graphql/bb_schema.json",
headers: {
"Authorization" => BulletinBoard.api_key
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Decidim
module BulletinBoard
VERSION = "0.5.1"
VERSION = "0.5.2"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ module Graphql
describe Client do
subject { described_class.client }

let(:server) { "https://bb.example.org" }
let(:api_key) { "IUdVVU0OF2qZgYIeJQnQHZPRloOh4srmXFZPPQx7" }
let(:client_url) { subject.instance_variable_get(:@url) }
let(:client_options) { subject.instance_variable_get(:@options) }

before do
# Decidim::BulletinBoard::Graphql::Client.class_variable_set(@client, nil)
Decidim::BulletinBoard.configure do |config|
config.server = server
config.api_key = api_key
end
end

it "has a client" do
expect(subject).not_to be_nil
end
Expand All @@ -29,12 +16,8 @@ module Graphql
expect(subject).to be_a Graphlient::Client
end

it "uses Bulletin board server as url" do
expect(server).to eql(client_url)
end

it "uses Bulletin board api key as authorization" do
expect(api_key).to eql(client_options[:headers]["Authorization"])
it "has a schema" do
expect(subject.schema).to be_a Graphlient::Schema
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions decidim-bulletin_board-ruby/spec/shared/client_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
config.identification_private_key = identification_private_key
end

allow(Decidim::BulletinBoard::Graphql::Client).to receive(:client).and_return(
Graphlient::Client.new(server, schema_path: "spec/fixtures/bb_schema.json")
)

if server.present?
if error_response
stub_request(:post, server).to_return(status: 500)
Expand Down

0 comments on commit 853be1d

Please sign in to comment.