decidim-bulletin_board 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41fe89dbbb133f650cbadd8e22d4cd7bb67687b13b591afddf70334b74c96bf0
4
- data.tar.gz: 850c0ccab8c4cc1b4a3837de32eaf386514d1ff8f99786510b9ca8f658ef56f5
3
+ metadata.gz: e7ea5bf51dea6c5779d7f99d2e3f475903c5779a19e7865788d25c8c321085eb
4
+ data.tar.gz: f163d6ee02b29caea225fa666dfb3527f429379c6ef5794340f3134ce7e57617
5
5
  SHA512:
6
- metadata.gz: 053e32a801dc8c535363a7ca3b391dc8ed67b70efd1afb584dad16451f4648bc3a129ef3847cacedf25100e7c641c67c3f477c0fef9aeb05e5c45f17da27b6de
7
- data.tar.gz: 9b8246def474df901503bcb72efe953b87710a3ca477248dc15d44a95703b2f3600afacbbe0a73e2c1dee098a18150111206b1ba9639f78b14cab067270b483a
6
+ metadata.gz: 0ecdaad8e933870d2ab6c83269ec19d1ad760118da289b23d7951ad34b7b5420730c989afd007cd7fb057b67e3e3a1438b65b3b9c17f2911eebb19e250af2ed5
7
+ data.tar.gz: 28001e140c7ed08bbbaaafe9686e56121806446144d75663a0630c2c8296d70c865dfc655860ae2bbe40265390224751d3e52c8b05791784cab99c024c6c2c21
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
- /.bundle/
1
+ /.bundle
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
data/Gemfile.lock CHANGED
@@ -1,70 +1,71 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- decidim-bulletin_board (0.15.2)
4
+ decidim-bulletin_board (0.16.0)
5
5
  byebug (~> 11.0)
6
6
  graphlient (~> 0.4.0)
7
7
  jwt (~> 2.2.2)
8
+ mimemagic (~> 0.3.7)
8
9
  rails (>= 5.0.0)
9
10
  wisper (~> 2.0.0)
10
11
 
11
12
  GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
14
- actioncable (6.1.3)
15
- actionpack (= 6.1.3)
16
- activesupport (= 6.1.3)
15
+ actioncable (6.1.3.1)
16
+ actionpack (= 6.1.3.1)
17
+ activesupport (= 6.1.3.1)
17
18
  nio4r (~> 2.0)
18
19
  websocket-driver (>= 0.6.1)
19
- actionmailbox (6.1.3)
20
- actionpack (= 6.1.3)
21
- activejob (= 6.1.3)
22
- activerecord (= 6.1.3)
23
- activestorage (= 6.1.3)
24
- activesupport (= 6.1.3)
20
+ actionmailbox (6.1.3.1)
21
+ actionpack (= 6.1.3.1)
22
+ activejob (= 6.1.3.1)
23
+ activerecord (= 6.1.3.1)
24
+ activestorage (= 6.1.3.1)
25
+ activesupport (= 6.1.3.1)
25
26
  mail (>= 2.7.1)
26
- actionmailer (6.1.3)
27
- actionpack (= 6.1.3)
28
- actionview (= 6.1.3)
29
- activejob (= 6.1.3)
30
- activesupport (= 6.1.3)
27
+ actionmailer (6.1.3.1)
28
+ actionpack (= 6.1.3.1)
29
+ actionview (= 6.1.3.1)
30
+ activejob (= 6.1.3.1)
31
+ activesupport (= 6.1.3.1)
31
32
  mail (~> 2.5, >= 2.5.4)
32
33
  rails-dom-testing (~> 2.0)
33
- actionpack (6.1.3)
34
- actionview (= 6.1.3)
35
- activesupport (= 6.1.3)
34
+ actionpack (6.1.3.1)
35
+ actionview (= 6.1.3.1)
36
+ activesupport (= 6.1.3.1)
36
37
  rack (~> 2.0, >= 2.0.9)
37
38
  rack-test (>= 0.6.3)
38
39
  rails-dom-testing (~> 2.0)
39
40
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
40
- actiontext (6.1.3)
41
- actionpack (= 6.1.3)
42
- activerecord (= 6.1.3)
43
- activestorage (= 6.1.3)
44
- activesupport (= 6.1.3)
41
+ actiontext (6.1.3.1)
42
+ actionpack (= 6.1.3.1)
43
+ activerecord (= 6.1.3.1)
44
+ activestorage (= 6.1.3.1)
45
+ activesupport (= 6.1.3.1)
45
46
  nokogiri (>= 1.8.5)
46
- actionview (6.1.3)
47
- activesupport (= 6.1.3)
47
+ actionview (6.1.3.1)
48
+ activesupport (= 6.1.3.1)
48
49
  builder (~> 3.1)
49
50
  erubi (~> 1.4)
50
51
  rails-dom-testing (~> 2.0)
51
52
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
52
- activejob (6.1.3)
53
- activesupport (= 6.1.3)
53
+ activejob (6.1.3.1)
54
+ activesupport (= 6.1.3.1)
54
55
  globalid (>= 0.3.6)
55
- activemodel (6.1.3)
56
- activesupport (= 6.1.3)
57
- activerecord (6.1.3)
58
- activemodel (= 6.1.3)
59
- activesupport (= 6.1.3)
60
- activestorage (6.1.3)
61
- actionpack (= 6.1.3)
62
- activejob (= 6.1.3)
63
- activerecord (= 6.1.3)
64
- activesupport (= 6.1.3)
65
- marcel (~> 0.3.1)
66
- mimemagic (~> 0.3.2)
67
- activesupport (6.1.3)
56
+ activemodel (6.1.3.1)
57
+ activesupport (= 6.1.3.1)
58
+ activerecord (6.1.3.1)
59
+ activemodel (= 6.1.3.1)
60
+ activesupport (= 6.1.3.1)
61
+ activestorage (6.1.3.1)
62
+ actionpack (= 6.1.3.1)
63
+ activejob (= 6.1.3.1)
64
+ activerecord (= 6.1.3.1)
65
+ activesupport (= 6.1.3.1)
66
+ marcel (~> 1.0.0)
67
+ mini_mime (~> 1.0.2)
68
+ activesupport (6.1.3.1)
68
69
  concurrent-ruby (~> 1.0, >= 1.0.2)
69
70
  i18n (>= 1.6, < 2)
70
71
  minitest (>= 5.1)
@@ -109,11 +110,12 @@ GEM
109
110
  nokogiri (>= 1.5.9)
110
111
  mail (2.7.1)
111
112
  mini_mime (>= 0.1.1)
112
- marcel (0.3.3)
113
- mimemagic (~> 0.3.2)
113
+ marcel (1.0.1)
114
114
  method_source (1.0.0)
115
- mimemagic (0.3.5)
116
- mini_mime (1.0.2)
115
+ mimemagic (0.3.10)
116
+ nokogiri (~> 1)
117
+ rake
118
+ mini_mime (1.0.3)
117
119
  mini_portile2 (2.5.0)
118
120
  minitest (5.14.4)
119
121
  multipart-post (2.1.1)
@@ -129,29 +131,29 @@ GEM
129
131
  rack (2.2.3)
130
132
  rack-test (1.1.0)
131
133
  rack (>= 1.0, < 3)
132
- rails (6.1.3)
133
- actioncable (= 6.1.3)
134
- actionmailbox (= 6.1.3)
135
- actionmailer (= 6.1.3)
136
- actionpack (= 6.1.3)
137
- actiontext (= 6.1.3)
138
- actionview (= 6.1.3)
139
- activejob (= 6.1.3)
140
- activemodel (= 6.1.3)
141
- activerecord (= 6.1.3)
142
- activestorage (= 6.1.3)
143
- activesupport (= 6.1.3)
134
+ rails (6.1.3.1)
135
+ actioncable (= 6.1.3.1)
136
+ actionmailbox (= 6.1.3.1)
137
+ actionmailer (= 6.1.3.1)
138
+ actionpack (= 6.1.3.1)
139
+ actiontext (= 6.1.3.1)
140
+ actionview (= 6.1.3.1)
141
+ activejob (= 6.1.3.1)
142
+ activemodel (= 6.1.3.1)
143
+ activerecord (= 6.1.3.1)
144
+ activestorage (= 6.1.3.1)
145
+ activesupport (= 6.1.3.1)
144
146
  bundler (>= 1.15.0)
145
- railties (= 6.1.3)
147
+ railties (= 6.1.3.1)
146
148
  sprockets-rails (>= 2.0.0)
147
149
  rails-dom-testing (2.0.3)
148
150
  activesupport (>= 4.2.0)
149
151
  nokogiri (>= 1.6)
150
152
  rails-html-sanitizer (1.3.0)
151
153
  loofah (~> 2.3)
152
- railties (6.1.3)
153
- actionpack (= 6.1.3)
154
- activesupport (= 6.1.3)
154
+ railties (6.1.3.1)
155
+ actionpack (= 6.1.3.1)
156
+ activesupport (= 6.1.3.1)
155
157
  method_source
156
158
  rake (>= 0.8.7)
157
159
  thor (~> 1.0)
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  s.require_paths = ["lib"]
27
27
 
28
+ s.add_dependency "mimemagic", "~> 0.3.7"
28
29
  s.add_dependency "rails", ">= 5.0.0"
29
30
 
30
31
  s.add_dependency "byebug", "~> 11.0"
@@ -14,6 +14,7 @@ require "decidim/bulletin_board/authority/publish_results"
14
14
  require "decidim/bulletin_board/authority/get_election_results"
15
15
  require "decidim/bulletin_board/voter/cast_vote"
16
16
  require "decidim/bulletin_board/voter/get_pending_message_status"
17
+ require "decidim/bulletin_board/test/reset_test_database"
17
18
 
18
19
  module Decidim
19
20
  module BulletinBoard
@@ -106,6 +107,15 @@ module Decidim
106
107
  publish_results.call
107
108
  end
108
109
 
110
+ if Rails.env.test?
111
+ def reset_test_database
112
+ reset_test_database = configure Test::ResetTestDatabase.new
113
+ reset_test_database.on(:ok) { |result| return result }
114
+ reset_test_database.on(:error) { |error_message| raise StandardError, error_message }
115
+ reset_test_database.call
116
+ end
117
+ end
118
+
109
119
  private
110
120
 
111
121
  attr_reader :settings, :graphql
@@ -398,6 +398,16 @@
398
398
  "enumValues": null,
399
399
  "possibleTypes": null
400
400
  },
401
+ {
402
+ "kind": "SCALAR",
403
+ "name": "Int",
404
+ "description": "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
405
+ "fields": null,
406
+ "inputFields": null,
407
+ "interfaces": null,
408
+ "enumValues": null,
409
+ "possibleTypes": null
410
+ },
401
411
  {
402
412
  "kind": "SCALAR",
403
413
  "name": "JSON",
@@ -875,6 +885,20 @@
875
885
  "isDeprecated": false,
876
886
  "deprecationReason": null
877
887
  },
888
+ {
889
+ "name": "resetTestDatabase",
890
+ "description": null,
891
+ "args": [
892
+
893
+ ],
894
+ "type": {
895
+ "kind": "OBJECT",
896
+ "name": "ResetTestDatabaseMutationPayload",
897
+ "ofType": null
898
+ },
899
+ "isDeprecated": false,
900
+ "deprecationReason": null
901
+ },
878
902
  {
879
903
  "name": "startKeyCeremony",
880
904
  "description": null,
@@ -1475,6 +1499,37 @@
1475
1499
  "enumValues": null,
1476
1500
  "possibleTypes": null
1477
1501
  },
1502
+ {
1503
+ "kind": "OBJECT",
1504
+ "name": "ResetTestDatabaseMutationPayload",
1505
+ "description": "Autogenerated return type of ResetTestDatabaseMutation",
1506
+ "fields": [
1507
+ {
1508
+ "name": "timestamp",
1509
+ "description": null,
1510
+ "args": [
1511
+
1512
+ ],
1513
+ "type": {
1514
+ "kind": "NON_NULL",
1515
+ "name": null,
1516
+ "ofType": {
1517
+ "kind": "SCALAR",
1518
+ "name": "Int",
1519
+ "ofType": null
1520
+ }
1521
+ },
1522
+ "isDeprecated": false,
1523
+ "deprecationReason": null
1524
+ }
1525
+ ],
1526
+ "inputFields": null,
1527
+ "interfaces": [
1528
+
1529
+ ],
1530
+ "enumValues": null,
1531
+ "possibleTypes": null
1532
+ },
1478
1533
  {
1479
1534
  "kind": "OBJECT",
1480
1535
  "name": "StartKeyCeremonyMutationPayload",
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module BulletinBoard
5
+ module Test
6
+ # This command uses the GraphQL client to clear the database in test mode.
7
+ class ResetTestDatabase < Decidim::BulletinBoard::Command
8
+ # Executes the command. Broadcasts these events:
9
+ #
10
+ # - :ok when everything is valid and the mutation operation is successful.
11
+ # - :error if query operation was not successful.
12
+ #
13
+ # Returns nothing.
14
+ def call
15
+ graphql.query do
16
+ mutation do
17
+ resetTestDatabase do
18
+ timestamp
19
+ end
20
+ end
21
+ end
22
+
23
+ broadcast(:ok)
24
+ rescue Graphlient::Errors::ServerError
25
+ broadcast(:error, "Sorry, something went wrong")
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Decidim
4
4
  module BulletinBoard
5
- VERSION = "0.15.2"
5
+ VERSION = "0.16.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-bulletin_board
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Morcillo
@@ -11,8 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-03-19 00:00:00.000000000 Z
14
+ date: 2021-04-06 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: mimemagic
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.3.7
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 0.3.7
16
30
  - !ruby/object:Gem::Dependency
17
31
  name: rails
18
32
  requirement: !ruby/object:Gem::Requirement
@@ -182,6 +196,7 @@ files:
182
196
  - lib/decidim/bulletin_board/jwk_utils.rb
183
197
  - lib/decidim/bulletin_board/message_identifier.rb
184
198
  - lib/decidim/bulletin_board/settings.rb
199
+ - lib/decidim/bulletin_board/test/reset_test_database.rb
185
200
  - lib/decidim/bulletin_board/version.rb
186
201
  - lib/decidim/bulletin_board/voter/cast_vote.rb
187
202
  - lib/decidim/bulletin_board/voter/get_pending_message_status.rb