flipper-ui 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/ui/authorization.ru +11 -49
- data/examples/ui/basic.ru +10 -10
- data/flipper-ui.gemspec +1 -0
- data/lib/flipper/ui/action.rb +50 -1
- data/lib/flipper/ui/actions/actors_gate.rb +11 -8
- data/lib/flipper/ui/actions/features.rb +2 -2
- data/lib/flipper/ui/actions/file.rb +1 -1
- data/lib/flipper/ui/actions/groups_gate.rb +1 -1
- data/lib/flipper/ui/actions/percentage_of_actors_gate.rb +1 -1
- data/lib/flipper/ui/actions/percentage_of_time_gate.rb +1 -1
- data/lib/flipper/ui/configuration.rb +6 -0
- data/lib/flipper/ui/decorators/feature.rb +3 -3
- data/lib/flipper/ui/middleware.rb +2 -1
- data/lib/flipper/ui/public/css/application.css +7 -0
- data/lib/flipper/ui/views/add_actor.erb +1 -1
- data/lib/flipper/ui/views/feature.erb +6 -6
- data/lib/flipper/ui/views/features.erb +2 -2
- data/lib/flipper/ui/views/layout.erb +5 -6
- data/lib/flipper/ui.rb +2 -2
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/ui/action_spec.rb +0 -2
- data/spec/flipper/ui/actions/actors_gate_spec.rb +70 -7
- data/spec/flipper/ui/actions/add_feature_spec.rb +0 -2
- data/spec/flipper/ui/actions/boolean_gate_spec.rb +18 -2
- data/spec/flipper/ui/actions/feature_spec.rb +18 -2
- data/spec/flipper/ui/actions/features_spec.rb +16 -5
- data/spec/flipper/ui/actions/file_spec.rb +0 -12
- data/spec/flipper/ui/actions/groups_gate_spec.rb +20 -5
- data/spec/flipper/ui/actions/home_spec.rb +0 -2
- data/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb +18 -3
- data/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb +18 -3
- data/spec/flipper/ui/configuration_spec.rb +0 -2
- data/spec/flipper/ui/decorators/feature_spec.rb +0 -2
- data/spec/flipper/ui/decorators/gate_spec.rb +0 -1
- data/spec/flipper/ui/util_spec.rb +0 -1
- data/spec/flipper/ui_spec.rb +0 -15
- metadata +19 -18
- data/docs/ui/README.md +0 -190
- data/docs/ui/images/banner.png +0 -0
- data/docs/ui/images/description.png +0 -0
- data/docs/ui/images/feature.png +0 -0
- data/docs/ui/images/features.png +0 -0
- data/lib/flipper/ui/public/octicons/LICENSE.txt +0 -9
- data/lib/flipper/ui/public/octicons/README.md +0 -1
- data/lib/flipper/ui/public/octicons/octicons-local.ttf +0 -0
- data/lib/flipper/ui/public/octicons/octicons.css +0 -236
- data/lib/flipper/ui/public/octicons/octicons.eot +0 -0
- data/lib/flipper/ui/public/octicons/octicons.svg +0 -200
- data/lib/flipper/ui/public/octicons/octicons.ttf +0 -0
- data/lib/flipper/ui/public/octicons/octicons.woff +0 -0
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::ActorsGate do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -45,6 +43,7 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
45
43
|
describe 'POST /features/:feature/actors' do
|
46
44
|
context 'enabling an actor' do
|
47
45
|
let(:value) { 'User;6' }
|
46
|
+
let(:multi_value) { 'User;5, User;7, User;9, User;12' }
|
48
47
|
|
49
48
|
before do
|
50
49
|
post 'features/search/actors',
|
@@ -53,7 +52,18 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
53
52
|
end
|
54
53
|
|
55
54
|
it 'adds item to members' do
|
56
|
-
expect(flipper[:search].actors_value).to include(
|
55
|
+
expect(flipper[:search].actors_value).to include(value)
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'adds item to multiple members' do
|
59
|
+
post 'features/search/actors',
|
60
|
+
{ 'value' => multi_value, 'operation' => 'enable', 'authenticity_token' => token },
|
61
|
+
'rack.session' => session
|
62
|
+
|
63
|
+
expect(flipper[:search].actors_value).to include('User;5')
|
64
|
+
expect(flipper[:search].actors_value).to include('User;7')
|
65
|
+
expect(flipper[:search].actors_value).to include('User;9')
|
66
|
+
expect(flipper[:search].actors_value).to include('User;12')
|
57
67
|
end
|
58
68
|
|
59
69
|
it 'redirects back to feature' do
|
@@ -61,12 +71,41 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
61
71
|
expect(last_response.headers['Location']).to eq('/features/search')
|
62
72
|
end
|
63
73
|
|
74
|
+
context "when feature name contains space" do
|
75
|
+
before do
|
76
|
+
post 'features/sp%20ace/actors',
|
77
|
+
{ 'value' => value, 'operation' => 'enable', 'authenticity_token' => token },
|
78
|
+
'rack.session' => session
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'adds item to members' do
|
82
|
+
expect(flipper["sp ace"].actors_value).to include('User;6')
|
83
|
+
end
|
84
|
+
|
85
|
+
it "redirects back to feature" do
|
86
|
+
expect(last_response.status).to be(302)
|
87
|
+
expect(last_response.headers['Location']).to eq('/features/sp%20ace')
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
64
91
|
context 'value contains whitespace' do
|
65
92
|
let(:value) { ' User;6 ' }
|
93
|
+
let(:multi_value) { ' User;5 , User;7 , User;9 , User;12 ' }
|
66
94
|
|
67
95
|
it 'adds item without whitespace' do
|
68
96
|
expect(flipper[:search].actors_value).to include('User;6')
|
69
97
|
end
|
98
|
+
|
99
|
+
it 'adds item to multi members without whitespace' do
|
100
|
+
post 'features/search/actors',
|
101
|
+
{ 'value' => multi_value, 'operation' => 'enable', 'authenticity_token' => token },
|
102
|
+
'rack.session' => session
|
103
|
+
|
104
|
+
expect(flipper[:search].actors_value).to include('User;5')
|
105
|
+
expect(flipper[:search].actors_value).to include('User;7')
|
106
|
+
expect(flipper[:search].actors_value).to include('User;9')
|
107
|
+
expect(flipper[:search].actors_value).to include('User;12')
|
108
|
+
end
|
70
109
|
end
|
71
110
|
|
72
111
|
context 'for an invalid actor value' do
|
@@ -75,7 +114,7 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
75
114
|
|
76
115
|
it 'redirects back to feature' do
|
77
116
|
expect(last_response.status).to be(302)
|
78
|
-
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22
|
117
|
+
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22%20is%20not%20a%20valid%20actor%20value.')
|
79
118
|
end
|
80
119
|
end
|
81
120
|
|
@@ -84,7 +123,7 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
84
123
|
|
85
124
|
it 'redirects back to feature' do
|
86
125
|
expect(last_response.status).to be(302)
|
87
|
-
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22
|
126
|
+
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22%20is%20not%20a%20valid%20actor%20value.')
|
88
127
|
end
|
89
128
|
end
|
90
129
|
end
|
@@ -92,16 +131,29 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
92
131
|
|
93
132
|
context 'disabling an actor' do
|
94
133
|
let(:value) { 'User;6' }
|
134
|
+
let(:multi_value) { 'User;5, User;7, User;9, User;12' }
|
95
135
|
|
96
136
|
before do
|
97
|
-
flipper[:search].enable_actor Flipper::Actor.new(
|
137
|
+
flipper[:search].enable_actor Flipper::Actor.new(value)
|
98
138
|
post 'features/search/actors',
|
99
139
|
{ 'value' => value, 'operation' => 'disable', 'authenticity_token' => token },
|
100
140
|
'rack.session' => session
|
101
141
|
end
|
102
142
|
|
103
143
|
it 'removes item from members' do
|
104
|
-
expect(flipper[:search].actors_value).not_to include(
|
144
|
+
expect(flipper[:search].actors_value).not_to include(value)
|
145
|
+
end
|
146
|
+
|
147
|
+
it 'removes item from multi members' do
|
148
|
+
multi_value.split(',').map(&:strip).each do |value|
|
149
|
+
flipper[:search].enable_actor Flipper::Actor.new(value)
|
150
|
+
end
|
151
|
+
|
152
|
+
post 'features/search/actors',
|
153
|
+
{ 'value' => multi_value, 'operation' => 'disable', 'authenticity_token' => token },
|
154
|
+
'rack.session' => session
|
155
|
+
|
156
|
+
expect(flipper[:search].actors_value).not_to eq(Set.new(multi_value.split(',').map(&:strip)))
|
105
157
|
end
|
106
158
|
|
107
159
|
it 'redirects back to feature' do
|
@@ -111,10 +163,21 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
111
163
|
|
112
164
|
context 'value contains whitespace' do
|
113
165
|
let(:value) { ' User;6 ' }
|
166
|
+
let(:multi_value) { ' User;5 , User;7 , User;9 , User;12 ' }
|
114
167
|
|
115
168
|
it 'removes item without whitespace' do
|
116
169
|
expect(flipper[:search].actors_value).not_to include('User;6')
|
117
170
|
end
|
171
|
+
|
172
|
+
it 'removes item without whitespace' do
|
173
|
+
multi_value.split(',').map(&:strip).each do |value|
|
174
|
+
flipper[:search].enable_actor Flipper::Actor.new(value)
|
175
|
+
end
|
176
|
+
post 'features/search/actors',
|
177
|
+
{ 'value' => multi_value, 'operation' => 'disable', 'authenticity_token' => token },
|
178
|
+
'rack.session' => session
|
179
|
+
expect(flipper[:search].actors_value).not_to eq(Set.new(multi_value.split(',').map(&:strip)))
|
180
|
+
end
|
118
181
|
end
|
119
182
|
end
|
120
183
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::BooleanGate do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -31,6 +29,24 @@ RSpec.describe Flipper::UI::Actions::BooleanGate do
|
|
31
29
|
end
|
32
30
|
end
|
33
31
|
|
32
|
+
context "with space in feature name" do
|
33
|
+
before do
|
34
|
+
flipper.disable :search
|
35
|
+
post 'features/sp%20ace/boolean',
|
36
|
+
{ 'action' => 'Enable', 'authenticity_token' => token },
|
37
|
+
'rack.session' => session
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'updates feature' do
|
41
|
+
expect(flipper.enabled?("sp ace")).to be(true)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'redirects back to feature' do
|
45
|
+
expect(last_response.status).to be(302)
|
46
|
+
expect(last_response.headers['Location']).to eq('/features/sp%20ace')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
34
50
|
context 'with disable' do
|
35
51
|
before do
|
36
52
|
flipper.enable :search
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::Feature do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -29,6 +27,24 @@ RSpec.describe Flipper::UI::Actions::Feature do
|
|
29
27
|
expect(last_response.headers['Location']).to eq('/features')
|
30
28
|
end
|
31
29
|
|
30
|
+
context "with space in feature name" do
|
31
|
+
before do
|
32
|
+
flipper.enable "sp ace"
|
33
|
+
delete '/features/sp%20ace',
|
34
|
+
{ 'authenticity_token' => token },
|
35
|
+
'rack.session' => session
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'removes feature' do
|
39
|
+
expect(flipper.features.map(&:key)).not_to include('sp ace')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'redirects to features' do
|
43
|
+
expect(last_response.status).to be(302)
|
44
|
+
expect(last_response.headers['Location']).to eq('/features')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
32
48
|
context 'when feature_removal_enabled is set to false' do
|
33
49
|
around do |example|
|
34
50
|
begin
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::Features do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -95,7 +93,7 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
95
93
|
expect(last_response.headers['Location']).to eq('/features/notifications_next')
|
96
94
|
end
|
97
95
|
|
98
|
-
context 'feature name
|
96
|
+
context 'feature name has whitespace at beginning and end' do
|
99
97
|
let(:feature_name) { ' notifications_next ' }
|
100
98
|
|
101
99
|
it 'adds feature without whitespace' do
|
@@ -103,6 +101,19 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
103
101
|
end
|
104
102
|
end
|
105
103
|
|
104
|
+
context 'feature name contains space' do
|
105
|
+
let(:feature_name) { 'notifications next' }
|
106
|
+
|
107
|
+
it 'adds feature with space' do
|
108
|
+
expect(flipper.features.map(&:key)).to include('notifications next')
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'redirects to feature' do
|
112
|
+
expect(last_response.status).to be(302)
|
113
|
+
expect(last_response.headers['Location']).to eq('/features/notifications%20next')
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
106
117
|
context 'for an invalid feature name' do
|
107
118
|
context 'empty feature name' do
|
108
119
|
let(:feature_name) { '' }
|
@@ -113,7 +124,7 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
113
124
|
|
114
125
|
it 'redirects back to feature' do
|
115
126
|
expect(last_response.status).to be(302)
|
116
|
-
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22
|
127
|
+
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22%20is%20not%20a%20valid%20feature%20name.')
|
117
128
|
end
|
118
129
|
end
|
119
130
|
|
@@ -126,7 +137,7 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
126
137
|
|
127
138
|
it 'redirects back to feature' do
|
128
139
|
expect(last_response.status).to be(302)
|
129
|
-
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22
|
140
|
+
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22%20is%20not%20a%20valid%20feature%20name.')
|
130
141
|
end
|
131
142
|
end
|
132
143
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::File do
|
4
2
|
describe 'GET /images/logo.png' do
|
5
3
|
before do
|
@@ -20,14 +18,4 @@ RSpec.describe Flipper::UI::Actions::File do
|
|
20
18
|
expect(last_response.status).to be(200)
|
21
19
|
end
|
22
20
|
end
|
23
|
-
|
24
|
-
describe 'GET /octicons/octicons.eot' do
|
25
|
-
before do
|
26
|
-
get '/octicons/octicons.eot'
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'responds with 200' do
|
30
|
-
expect(last_response.status).to be(200)
|
31
|
-
end
|
32
|
-
end
|
33
21
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::GroupsGate do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -60,6 +58,23 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
|
|
60
58
|
expect(last_response.headers['Location']).to eq('/features/search')
|
61
59
|
end
|
62
60
|
|
61
|
+
context 'feature name contains space' do
|
62
|
+
before do
|
63
|
+
post 'features/sp%20ace/groups',
|
64
|
+
{ 'value' => group_name, 'operation' => 'enable', 'authenticity_token' => token },
|
65
|
+
'rack.session' => session
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'adds item to members' do
|
69
|
+
expect(flipper["sp ace"].groups_value).to include('admins')
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'redirects back to feature' do
|
73
|
+
expect(last_response.status).to be(302)
|
74
|
+
expect(last_response.headers['Location']).to eq('/features/sp%20ace')
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
63
78
|
context 'group name contains whitespace' do
|
64
79
|
let(:group_name) { ' admins ' }
|
65
80
|
|
@@ -74,7 +89,7 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
|
|
74
89
|
|
75
90
|
it 'redirects back to feature' do
|
76
91
|
expect(last_response.status).to be(302)
|
77
|
-
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The
|
92
|
+
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The%20group%20named%20%22not_here%22%20has%20not%20been%20registered.')
|
78
93
|
end
|
79
94
|
end
|
80
95
|
|
@@ -83,7 +98,7 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
|
|
83
98
|
|
84
99
|
it 'redirects back to feature' do
|
85
100
|
expect(last_response.status).to be(302)
|
86
|
-
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The
|
101
|
+
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The%20group%20named%20%22%22%20has%20not%20been%20registered.')
|
87
102
|
end
|
88
103
|
end
|
89
104
|
|
@@ -92,7 +107,7 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
|
|
92
107
|
|
93
108
|
it 'redirects back to feature' do
|
94
109
|
expect(last_response.status).to be(302)
|
95
|
-
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The
|
110
|
+
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The%20group%20named%20%22%22%20has%20not%20been%20registered.')
|
96
111
|
end
|
97
112
|
end
|
98
113
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::PercentageOfActorsGate do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -30,6 +28,23 @@ RSpec.describe Flipper::UI::Actions::PercentageOfActorsGate do
|
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
31
|
+
context 'with space in feature name' do
|
32
|
+
before do
|
33
|
+
post 'features/sp%20ace/percentage_of_actors',
|
34
|
+
{ 'value' => '24', 'authenticity_token' => token },
|
35
|
+
'rack.session' => session
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'enables the feature' do
|
39
|
+
expect(flipper["sp ace"].percentage_of_actors_value).to be(24)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'redirects back to feature' do
|
43
|
+
expect(last_response.status).to be(302)
|
44
|
+
expect(last_response.headers['Location']).to eq('/features/sp%20ace')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
33
48
|
context 'with invalid value' do
|
34
49
|
before do
|
35
50
|
post 'features/search/percentage_of_actors',
|
@@ -43,7 +58,7 @@ RSpec.describe Flipper::UI::Actions::PercentageOfActorsGate do
|
|
43
58
|
|
44
59
|
it 'redirects back to feature' do
|
45
60
|
expect(last_response.status).to be(302)
|
46
|
-
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid
|
61
|
+
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid%20percentage%20of%20actors%20value:%20value%20must%20be%20a%20positive%20number%20less%20than%20or%20equal%20to%20100,%20but%20was%20555')
|
47
62
|
end
|
48
63
|
end
|
49
64
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI::Actions::PercentageOfTimeGate do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -30,6 +28,23 @@ RSpec.describe Flipper::UI::Actions::PercentageOfTimeGate do
|
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
31
|
+
context 'with space in feature name' do
|
32
|
+
before do
|
33
|
+
post 'features/sp%20ace/percentage_of_time',
|
34
|
+
{ 'value' => '24', 'authenticity_token' => token },
|
35
|
+
'rack.session' => session
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'enables the feature' do
|
39
|
+
expect(flipper["sp ace"].percentage_of_time_value).to be(24)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'redirects back to feature' do
|
43
|
+
expect(last_response.status).to be(302)
|
44
|
+
expect(last_response.headers['Location']).to eq('/features/sp%20ace')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
33
48
|
context 'with invalid value' do
|
34
49
|
before do
|
35
50
|
post 'features/search/percentage_of_time',
|
@@ -43,7 +58,7 @@ RSpec.describe Flipper::UI::Actions::PercentageOfTimeGate do
|
|
43
58
|
|
44
59
|
it 'redirects back to feature' do
|
45
60
|
expect(last_response.status).to be(302)
|
46
|
-
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid
|
61
|
+
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid%20percentage%20of%20time%20value:%20value%20must%20be%20a%20positive%20number%20less%20than%20or%20equal%20to%20100,%20but%20was%20555')
|
47
62
|
end
|
48
63
|
end
|
49
64
|
end
|
data/spec/flipper/ui_spec.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
1
|
RSpec.describe Flipper::UI do
|
4
2
|
let(:token) do
|
5
3
|
if Rack::Protection::AuthenticityToken.respond_to?(:random_token)
|
@@ -24,19 +22,6 @@ RSpec.describe Flipper::UI do
|
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
27
|
-
describe 'Initializing middleware lazily with a block' do
|
28
|
-
let(:app) do
|
29
|
-
build_app(-> { flipper })
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'works' do
|
33
|
-
flipper.enable :some_great_feature
|
34
|
-
get '/features'
|
35
|
-
expect(last_response.status).to be(200)
|
36
|
-
expect(last_response.body).to include('some_great_feature')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
25
|
describe 'Request method unsupported by action' do
|
41
26
|
it 'raises error' do
|
42
27
|
expect do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -56,14 +56,14 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
59
|
+
version: 0.23.0
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.
|
66
|
+
version: 0.23.0
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubi
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,6 +84,20 @@ dependencies:
|
|
84
84
|
- - "<"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 2.0.0
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: sanitize
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - "<"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '7'
|
94
|
+
type: :runtime
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - "<"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '7'
|
87
101
|
description:
|
88
102
|
email:
|
89
103
|
- nunemaker@gmail.com
|
@@ -91,11 +105,6 @@ executables: []
|
|
91
105
|
extensions: []
|
92
106
|
extra_rdoc_files: []
|
93
107
|
files:
|
94
|
-
- docs/ui/README.md
|
95
|
-
- docs/ui/images/banner.png
|
96
|
-
- docs/ui/images/description.png
|
97
|
-
- docs/ui/images/feature.png
|
98
|
-
- docs/ui/images/features.png
|
99
108
|
- examples/ui/authorization.ru
|
100
109
|
- examples/ui/basic.ru
|
101
110
|
- flipper-ui.gemspec
|
@@ -123,14 +132,6 @@ files:
|
|
123
132
|
- lib/flipper/ui/public/css/application.css
|
124
133
|
- lib/flipper/ui/public/images/logo.png
|
125
134
|
- lib/flipper/ui/public/js/application.js
|
126
|
-
- lib/flipper/ui/public/octicons/LICENSE.txt
|
127
|
-
- lib/flipper/ui/public/octicons/README.md
|
128
|
-
- lib/flipper/ui/public/octicons/octicons-local.ttf
|
129
|
-
- lib/flipper/ui/public/octicons/octicons.css
|
130
|
-
- lib/flipper/ui/public/octicons/octicons.eot
|
131
|
-
- lib/flipper/ui/public/octicons/octicons.svg
|
132
|
-
- lib/flipper/ui/public/octicons/octicons.ttf
|
133
|
-
- lib/flipper/ui/public/octicons/octicons.woff
|
134
135
|
- lib/flipper/ui/util.rb
|
135
136
|
- lib/flipper/ui/views/add_actor.erb
|
136
137
|
- lib/flipper/ui/views/add_feature.erb
|
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
178
|
- !ruby/object:Gem::Version
|
178
179
|
version: '0'
|
179
180
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
+
rubygems_version: 3.1.2
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
184
|
summary: UI for the Flipper gem
|