From 670046942b9dacf0979b58c3b15ea9f1952f0e1c Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Sat, 12 Aug 2017 20:47:08 +1000 Subject: [PATCH 01/11] wip(dashboard api): Add dashboard wip code because laptop screen is dying --- lib/pact_broker/api/resources/dashboard.rb | 23 +++++++++++++++++++ lib/pact_broker/dashboard/service.rb | 0 lib/pact_broker/domain/dashboard.rb | 12 ++++++++++ spec/features/get_dashboard_spec.rb | 23 +++++++++++++++++++ .../api/resources/dashboard_spec.rb | 16 +++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 lib/pact_broker/api/resources/dashboard.rb create mode 100644 lib/pact_broker/dashboard/service.rb create mode 100644 lib/pact_broker/domain/dashboard.rb create mode 100644 spec/features/get_dashboard_spec.rb create mode 100644 spec/lib/pact_broker/api/resources/dashboard_spec.rb diff --git a/lib/pact_broker/api/resources/dashboard.rb b/lib/pact_broker/api/resources/dashboard.rb new file mode 100644 index 000000000..e4a54f25d --- /dev/null +++ b/lib/pact_broker/api/resources/dashboard.rb @@ -0,0 +1,23 @@ +require 'pact_broker/api/resources/base_resource' + +module PactBroker + module Api + module Resources + + class Dashboard < BaseResource + + def content_types_provided + [["application/hal+json", :to_json]] + end + + def allowed_methods + ["GET"] + end + + def to_json + + end + end + end + end +end diff --git a/lib/pact_broker/dashboard/service.rb b/lib/pact_broker/dashboard/service.rb new file mode 100644 index 000000000..e69de29bb diff --git a/lib/pact_broker/domain/dashboard.rb b/lib/pact_broker/domain/dashboard.rb new file mode 100644 index 000000000..6f9dbd0d9 --- /dev/null +++ b/lib/pact_broker/domain/dashboard.rb @@ -0,0 +1,12 @@ +module PactBroker + module Domain + class Dashboard + + def initialize *relationships + + end + + + end + end +end diff --git a/spec/features/get_dashboard_spec.rb b/spec/features/get_dashboard_spec.rb new file mode 100644 index 000000000..cd350f29e --- /dev/null +++ b/spec/features/get_dashboard_spec.rb @@ -0,0 +1,23 @@ +require 'spec/support/test_data_builder' + +describe "Get dashboard" do + + let(:path) { "/dashboard" } + let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) } + + before do + TestDataBuilder.new + .create_consumer("Foo") + .create_provider("Bar") + .create_webhook + .create_consumer_version("1.2.3") + .create_pact + .create_verification + end + + subject { get path; last_response } + + it "returns a 200 HAL JSON response", pending: true do + expect(subject).to be_a_hal_json_success_response + end +end diff --git a/spec/lib/pact_broker/api/resources/dashboard_spec.rb b/spec/lib/pact_broker/api/resources/dashboard_spec.rb new file mode 100644 index 000000000..90b77a866 --- /dev/null +++ b/spec/lib/pact_broker/api/resources/dashboard_spec.rb @@ -0,0 +1,16 @@ +require 'pact_broker/api/resources/dashboard' + +module PactBroker + module Api + module Resources + + describe Dashboard do + + let(:path) { "/dashboard" } + subject { get path; last_response } + + + end + end + end +end From 43647c7fffa9018b254fb0d96450bc91eb5d8f85 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 11 Sep 2017 12:55:29 +1000 Subject: [PATCH 02/11] docs: add README_SAAS.md --- README.md | 5 +++++ README_SAAS.md | 1 + 2 files changed, 6 insertions(+) create mode 100644 README_SAAS.md diff --git a/README.md b/README.md index 164fdfd65..78c36dd00 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +This project is a fork of the open source [Pact Broker](https://github.com/pact-foundation/pact_broker). +See [README_SAAS](./README_SAAS.md) for documentation on the SAAS Pact Broker. + + + # Pact Broker [![Gem Version](https://badge.fury.io/rb/pact_broker.svg)](http://badge.fury.io/rb/pact_broker) [![Build Status](https://travis-ci.org/pact-foundation/pact_broker.svg?branch=master)](https://travis-ci.org/pact-foundation/pact_broker) [![Join the chat at https://gitter.im/pact-foundation/pact_broker](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pact-foundation/pact_broker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/README_SAAS.md b/README_SAAS.md new file mode 100644 index 000000000..1927526ad --- /dev/null +++ b/README_SAAS.md @@ -0,0 +1 @@ +# SAAS Pact Broker From 65fbe111a3f27ba6f6f5b98a3529188b1b6652bb Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 11 Sep 2017 12:57:13 +1000 Subject: [PATCH 03/11] docs: add instructions for updating from open source repo --- README_SAAS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README_SAAS.md b/README_SAAS.md index 1927526ad..52f82f6f4 100644 --- a/README_SAAS.md +++ b/README_SAAS.md @@ -1 +1,8 @@ # SAAS Pact Broker + +## Updating code from the open source repository + + git remote add upstream git@github.com:pact-foundation/pact_broker.git + git pull upstream master + bundle exec rake + git push From 612c33d7a544cc4159975bc0ebab3c397578f104 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 2 Oct 2017 13:11:53 +1100 Subject: [PATCH 04/11] docs(readme saas): updated --- README_SAAS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_SAAS.md b/README_SAAS.md index 52f82f6f4..07b74501e 100644 --- a/README_SAAS.md +++ b/README_SAAS.md @@ -3,6 +3,6 @@ ## Updating code from the open source repository git remote add upstream git@github.com:pact-foundation/pact_broker.git - git pull upstream master + git pull upstream master #(or appropriate branch) bundle exec rake git push From 14ce1a8eda297ba344107ffef5d929a42292f371 Mon Sep 17 00:00:00 2001 From: Yun Date: Wed, 18 Oct 2017 11:17:27 +1100 Subject: [PATCH 05/11] apply dius logo, also align the nav bar the same width as the table. --- .../ui/views/relationships/show.haml | 15 +++++++----- public/images/logo@2x.png | Bin 0 -> 8097 bytes public/stylesheets/relationships.css | 23 ++++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 public/images/logo@2x.png diff --git a/lib/pact_broker/ui/views/relationships/show.haml b/lib/pact_broker/ui/views/relationships/show.haml index 6f7a971df..b33c202c2 100644 --- a/lib/pact_broker/ui/views/relationships/show.haml +++ b/lib/pact_broker/ui/views/relationships/show.haml @@ -4,13 +4,16 @@ %script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'} %script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'} %script{type: 'text/javascript', src:'/js/bootstrap.min.js'} - %nav.navbase-default.navbar-right{role: "navigation"} - .container - %ul - %li.navbar-right - %a{href: '/hal-browser/browser.html'} - HAL Browser .container + %nav.navbase-default{role: "navigation", id: "navigation"} + .container-fluid + .navbar-header + %a.navbar-brand{href: "#"} + %img{alt: "Brand", src: "/images/logo@2x.png", height: "24px"} + %ul.navbar-right + %li + %a{href: '/hal-browser/browser.html'} + HAL Browser %h1.page-header Pacts %table.table.table-bordered.table-striped{id: 'relationships'} diff --git a/public/images/logo@2x.png b/public/images/logo@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..003ad0380d123cdf219ea252cfea181e0fa2871e GIT binary patch literal 8097 zcmaKRcQ{;M*S6@4GDJ5RC5bW^B^V`)HbnFiM3fn$L@>9#3Ea^Wi3aPsJ2<0F&<>6PUIS=l5)v|D zS2IhTrT#5Nl&8Cd!yg?9e|HSgnuJ7I)gR-4azo?5NVK!7hl;>%ONRj1)lo&@_H})z zK1KuW;;IwqjW!K5Fhd2ppzsyD#O{)$8ZcQnoc?C*Zx1FPt-BJdZkB60j@T2cV~ zmkQ2JMd0tCEcK1R8lK*0@O6pn;wY%J6j&Z6A$9$_yu367EDe>Cm4r%3O38>z!4zd> z6`@e@KbHW}o42ErqKT&VKfZ{Pihv6ahf$Q2^z-wR@RO17^mdk%g27;tP-#hNX>p>4 zI5xlo=io2yfff80K@*KddAnk8uAUy?KZp)UPam9$05Q_Pm*9^153C3FpEMB@Ch6~h zk(82v{#nw$iu(Hhx2n7Qf3&eU6ZHSY`@aHX%>poJNfR{I)5jY{+&Cw}Kdvx}8s2CJ zoTs;$r|12DvuNbviSxv|cw)dB8h>RCEUfQ#A&6L3Q2|1Fd3`imnD$)h%3Uhq#Beo0-WSR z(U}2j@2b)%oubNfciPQAUHokC-fo_syW8kt{*3nG;x?X{nw%6qVbpvsNa1xtVFUQF zP;Wn>JU5;rT%!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UHkb)m?KI6TWgn!GxSz1wD%m1vJhJt5*HuBBOYt(l%`uU}K8k{WC zWlO%<7E8|Hl>?chJH-6t#{-#1?2kyrdXQN=$yA-MIif~a)5{G*DL~A0#FDu2UfIjLj`X^9yuMH?q-!(bj>kQ?XUscR^ekPQPw7XX-R%U0 zT6GA%v623;AMlOo)3mVxgE&;fBM;2xy2w2UxO9#j^{eeBU{=XEhHWz48F}Q@3795# zQaj-QpeJ2Y{MSL z6VNM?+_4e7Y^IS(eJ1qKv)x0e)J0~YiA1wVkPFiw)qT|8h#S?(7dThVDQd||4rGYY z>f_QH$~-**;Tqy@QiZF-B@u6O5#BpHp%!X4gaFspUU9aEInc0a$@IKp%*R@ru86-v zU&j}rK02;++O|Z|^SkeH)~pL|SJ~WIBMZ`+kNO@g&MS-hy6)A%HuQK9U`_xBV)s>A zzSzrZ%UDN&_!3)hj{d|xzuLWEHukQZOiW4mPJO?L4JREYS8N=|#2hEdPwRur_A?!Q zDBcsG&HeH!NQZ%3up&gA<|Y`ZK&CxDxy%J_3jnx=sgyWV`}QsND_1UZQD`m|pTBEG zvCtTFjD55RO~cerh8!pZ?+#0y5R3@Edd_~ryCb6R+`Lhnj*vbQB62vn zP?k}_N3?V|VmdfqJ*Yd#0Y>L8QSjbQV){e*_zU8T6qWt=8c4K=XQK#=tWxx7{3TEJ zKb#Z(BYV7B8Q5Bo@=TILE`%!r-0~V=p!B};diP&+5ZFMQW7A9_DO3aLr4lHdtgnz% zQJc>G7rB)5+LF90Z1ia)lMmT97V}hghGIRTuCR}kQi-fYWGsM^XaAQv3tnluK7otE zx9jK5-<(vweep)(T-w^v@XKYonf>RnA+6PA@RD32N!Dot6=sQFpCz(xA(^-TCa4HV zFJ?y}>pqF1y1VZ@DzE-UjWu76R{k literal 0 HcmV?d00001 diff --git a/public/stylesheets/relationships.css b/public/stylesheets/relationships.css index d3ced8b42..eb6d11e3d 100644 --- a/public/stylesheets/relationships.css +++ b/public/stylesheets/relationships.css @@ -67,3 +67,26 @@ span.pact svg path { span.pact:hover svg path { fill: #2a6496; } + +#navigation .container-fluid { + padding-left: 0px; + display: flex; + justify-content: space-between; + align-items: center; +} + +#navigation .container-fluid .navbar-brand { + padding: 0px; + display: flex; + align-items: center; +} + +#navigation .container-fluid:before { + content: '' !important; + display: none; +} + +#navigation .container-fluid:after { + content: '' !important; + display: none; +} From 8a4e7273c78dadf9a57931a11a5f6e5569f236b0 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Sat, 11 Nov 2017 20:26:00 +1100 Subject: [PATCH 06/11] feat: add dius logo to new index view with tags --- .../ui/views/index/show-with-tags.haml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/pact_broker/ui/views/index/show-with-tags.haml b/lib/pact_broker/ui/views/index/show-with-tags.haml index 682a347a8..cc54c70bc 100644 --- a/lib/pact_broker/ui/views/index/show-with-tags.haml +++ b/lib/pact_broker/ui/views/index/show-with-tags.haml @@ -4,13 +4,16 @@ %script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'} %script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'} %script{type: 'text/javascript', src:'/js/bootstrap.min.js'} - %nav.navbase-default.navbar-right{role: "navigation"} - .container - %ul - %li.navbar-right - %a{ href: '/hal-browser/browser.html' } - API Browser .container + %nav.navbase-default{role: "navigation", id: "navigation"} + .container-fluid + .navbar-header + %a.navbar-brand{href: "#"} + %img{alt: "Brand", src: "/images/logo@2x.png", height: "24px"} + %ul.navbar-right + %li + %a{href: '/hal-browser/browser.html'} + API Browser %h1.page-header Pacts %table.table.table-bordered.table-striped{ id: 'relationships' } From cd7fb9d7b29bb968348215201959737e43b49220 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Sat, 11 Nov 2017 20:26:37 +1100 Subject: [PATCH 07/11] chore: update example broker path to point to local codebase --- example/Gemfile | 2 +- example/pact_broker_database.sqlite3 | Bin 126976 -> 163840 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/example/Gemfile b/example/Gemfile index 906ee9d78..74277a2c5 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'pact_broker' +gem 'pact_broker', path: '..' gem 'sqlite3', '~>1.3' # Sqlite is just for testing, replace this with your choice of database driver # gem 'pg' # Recommended production gem for postgres gem 'thin', '~>1.7' # Keep, or replace with your choice of web server diff --git a/example/pact_broker_database.sqlite3 b/example/pact_broker_database.sqlite3 index 91eb851d4f8084969a850094d54407ece09b4637..651b08675c2c3efbe37e798b6a1628af9d9a6038 100644 GIT binary patch delta 9775 zcmd^Fd2Ackndh64I6Q_NDHcr~wlz9QN{U2EmK-HL0y!OECKd;kv0tc*Z2WBK%HxM)=;f z`nt2ih|9tTEKBmt@nmvdl9%P#TsD?WWFVVEAFi{q9?PPfjvb55M)35tS3*4^uw4VG zu9G#UUz>J5HMWV}+GSSP@!+gFYX?`aedNXo=O%|~*<}AO`z(Ln##$Q9zpFjSegeD( zJ_B}`er{S;>gx_%Z+R9hf$NW50T+R)UILEm=UDI^PHo`987%1fc^({Pd1w&*v0ST9 zy)Hbpr}hOAfRnv&m^VFZ622;IcHVIOi{k}**7gfqi@CREm5rO8HNRqhh3PT9Wx8p4 z9V*P(o_zOXoZI689}cPA7eH&HcYG>1wl65|8+&9|Pz>wqR35)MqJ&oK)lXgkf^wL1 z*JX0EvvMXA79U9_<8maSoB^HcOBcX;<>l2nWt-KkzIFk)m7lEEqX*?*Z#OAtL9Tr=z_^uHZI3F?yj@=tnaxV@p-BldHR^*G zflc`VTXSd7U_aVRm9m9pvB+?<@2qms6jnYAXAy>{1lIeAzdn-(*2 zT%OH}*`@v-n}~morIQO{IW;6v|HA^BM$4w8STrNXvr92eKr(^E&BBPvEy!s&D{jTp zYQzlIVtfsf$=$9i#k4XjE zCwkt)xq?BYi5`!9nALyv*V|iflK)&j&yUSWNJ}8SK#bhtJ~Lw%RQ%DwQSIG#K}`rW6`iredlGE zf~?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MqWp9KOFZw|jT@ayNBe-_Tp+%S?Q!mPAG6TaYtH2^A&V_3o-8)8Ss6_Mt6P zBq3ZEJ4GLIDH%9XS#jwvh&~B@@IyrQRf#YHDSYd0DpU^~IM4I@opYY^{K8>6{FNNf zGmjDkQK+l~greog*-@gxw5e7k#B3xBdCVrWp(|eu-eu@kuC&UkXy)3)CZnm+rMi|0 zW|>({m`xuTU=zzNWgHk1;4KQLFVQ@Tuesxv8#{iUiwwxk3`!OypMi(X#vJA-1M&(quE`-kL8Xva%O4%LvX ztp*~3ba}g2>ul$R+W~J?7B`FCB=*J8sm5f)%(^L=OB@MAh0-n%e`e??iou1IAgo?jW{zpi8QVtpUI5 zM0JoZIn)-M-i2<__q*%K Date: Sat, 11 Nov 2017 20:32:30 +1100 Subject: [PATCH 08/11] feat: allow database to have missing migration files so that we can deploy branches with different migrations to the same database --- lib/pact_broker/db.rb | 3 ++- lib/pact_broker/db/migrate.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/db.rb b/lib/pact_broker/db.rb index eb7289bc0..35ad7031d 100644 --- a/lib/pact_broker/db.rb +++ b/lib/pact_broker/db.rb @@ -18,7 +18,8 @@ def self.connection def self.run_migrations database_connection Sequel.extension :migration - Sequel::TimestampMigrator.new(database_connection, PactBroker::DB::MIGRATIONS_DIR).run + options = { allow_missing_migration_files: true } + Sequel::TimestampMigrator.new(database_connection, PactBroker::DB::MIGRATIONS_DIR, options).run end def self.validate_connection_config diff --git a/lib/pact_broker/db/migrate.rb b/lib/pact_broker/db/migrate.rb index 22ea3364a..55af26473 100644 --- a/lib/pact_broker/db/migrate.rb +++ b/lib/pact_broker/db/migrate.rb @@ -7,8 +7,9 @@ module DB class Migrate def self.call database_connection, options = {} db_migrations_dir = PactBroker.project_root.join('db','migrations') + default_options = { allow_missing_migration_files: true } puts "Running migrations in directory #{db_migrations_dir}, target=#{options.fetch(:target, 'end')}" - Sequel::TimestampMigrator.new(database_connection, db_migrations_dir, options).run + Sequel::TimestampMigrator.new(database_connection, db_migrations_dir, default_options.merge(options)).run end end end From 088977350a5818079db3d5435f8f7f9195e69b79 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 15 Dec 2017 15:03:02 +1100 Subject: [PATCH 09/11] chore: add saas_sessions to list of tables to cleanup --- tasks/database.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/database.rb b/tasks/database.rb index fbe953c3d..bebeefc81 100644 --- a/tasks/database.rb +++ b/tasks/database.rb @@ -15,7 +15,7 @@ module Database # I'm sure there is a better way to do this, but there are # more urgent things that I need to spend my time on right now. - TABLES = [:labels, :webhook_executions, :triggered_webhooks, :config, :pacts, :pact_version_contents, :tags, :verifications, :pact_publications, :pact_versions, :webhook_headers, :webhooks, :versions, :pacticipants].freeze + TABLES = [:saas_sessions, :labels, :webhook_executions, :triggered_webhooks, :config, :pacts, :pact_version_contents, :tags, :verifications, :pact_publications, :pact_versions, :webhook_headers, :webhooks, :versions, :pacticipants].freeze extend self From 29f7b932a68d15376f91933976588aeeae54038f Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 8 Jan 2018 14:36:28 +1100 Subject: [PATCH 10/11] docs: add link to the docker project --- README_SAAS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README_SAAS.md b/README_SAAS.md index 07b74501e..2b44b3a40 100644 --- a/README_SAAS.md +++ b/README_SAAS.md @@ -6,3 +6,9 @@ git pull upstream master #(or appropriate branch) bundle exec rake git push + +Remember to merge the changes in to any WIP branches. + +## Deploying + +See the [RELEASING.md](https://github.com/DiUS/pact-broker-docker-private/blob/master/RELEASING.md) file in the pact-broker-docker-private project. From 91fa347c322387e80495fc754132519664904327 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Sat, 12 Aug 2017 20:47:08 +1000 Subject: [PATCH 11/11] wip(dashboard api): Add dashboard wip code because laptop screen is dying --- lib/pact_broker/api/resources/dashboard.rb | 23 +++++++++++++++++++ lib/pact_broker/dashboard/service.rb | 0 lib/pact_broker/domain/dashboard.rb | 12 ++++++++++ spec/features/get_dashboard_spec.rb | 23 +++++++++++++++++++ .../api/resources/dashboard_spec.rb | 16 +++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 lib/pact_broker/api/resources/dashboard.rb create mode 100644 lib/pact_broker/dashboard/service.rb create mode 100644 lib/pact_broker/domain/dashboard.rb create mode 100644 spec/features/get_dashboard_spec.rb create mode 100644 spec/lib/pact_broker/api/resources/dashboard_spec.rb diff --git a/lib/pact_broker/api/resources/dashboard.rb b/lib/pact_broker/api/resources/dashboard.rb new file mode 100644 index 000000000..e4a54f25d --- /dev/null +++ b/lib/pact_broker/api/resources/dashboard.rb @@ -0,0 +1,23 @@ +require 'pact_broker/api/resources/base_resource' + +module PactBroker + module Api + module Resources + + class Dashboard < BaseResource + + def content_types_provided + [["application/hal+json", :to_json]] + end + + def allowed_methods + ["GET"] + end + + def to_json + + end + end + end + end +end diff --git a/lib/pact_broker/dashboard/service.rb b/lib/pact_broker/dashboard/service.rb new file mode 100644 index 000000000..e69de29bb diff --git a/lib/pact_broker/domain/dashboard.rb b/lib/pact_broker/domain/dashboard.rb new file mode 100644 index 000000000..6f9dbd0d9 --- /dev/null +++ b/lib/pact_broker/domain/dashboard.rb @@ -0,0 +1,12 @@ +module PactBroker + module Domain + class Dashboard + + def initialize *relationships + + end + + + end + end +end diff --git a/spec/features/get_dashboard_spec.rb b/spec/features/get_dashboard_spec.rb new file mode 100644 index 000000000..cd350f29e --- /dev/null +++ b/spec/features/get_dashboard_spec.rb @@ -0,0 +1,23 @@ +require 'spec/support/test_data_builder' + +describe "Get dashboard" do + + let(:path) { "/dashboard" } + let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) } + + before do + TestDataBuilder.new + .create_consumer("Foo") + .create_provider("Bar") + .create_webhook + .create_consumer_version("1.2.3") + .create_pact + .create_verification + end + + subject { get path; last_response } + + it "returns a 200 HAL JSON response", pending: true do + expect(subject).to be_a_hal_json_success_response + end +end diff --git a/spec/lib/pact_broker/api/resources/dashboard_spec.rb b/spec/lib/pact_broker/api/resources/dashboard_spec.rb new file mode 100644 index 000000000..90b77a866 --- /dev/null +++ b/spec/lib/pact_broker/api/resources/dashboard_spec.rb @@ -0,0 +1,16 @@ +require 'pact_broker/api/resources/dashboard' + +module PactBroker + module Api + module Resources + + describe Dashboard do + + let(:path) { "/dashboard" } + subject { get path; last_response } + + + end + end + end +end