fluentd-ui 0.3.19 → 0.3.20

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.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b0f1b68a4e226bf802f55f575819573167d0a07
4
- data.tar.gz: 2dc75b1106dc8043fd4e6f90ca2e464265fecdff
3
+ metadata.gz: f2bd1ea18819e32b9455400f25a12171bbac521d
4
+ data.tar.gz: b1bce06af9405bdaf2ec28da59633a09306bc4b2
5
5
  SHA512:
6
- metadata.gz: b3a5a339fbed830c5ece5f51c624673dac914cb7989769ba717a55b8695efec0acb59411746be05f78c4fe18d4e5861cb7e86d8dc822b94f0cf40f75c2e85a7c
7
- data.tar.gz: 20799f4df412c8e75568a727ebdbe5fd6c3ee410f9ee896ea1b311ea3d3b3c3bcbcb657a5b2f57d5e27d3fd17e1ec410b0f3023b3cb5cac72758b95c5dcc44ee
6
+ metadata.gz: 9f55f9200efb1ae1144ccce419169d3984e649526280928f4d1ab999494eed28078b33acbbac0a2680b542d4ca0dc95d4ff5f1a7b7a4eae664e03bf2066ab6f4
7
+ data.tar.gz: aee4e40d091ac025b15bb6cecdfd3b9d323977c6b4cb605591930a03c2e1f3ead755a8708f43076f855bf847526379f02526348c71b20712d13990c765d50ec0
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 0.3.20 - 2015/04/10
2
+ * [fixed] #175 Fix the bug password can be changed without match between new password and password confirmation.
3
+ * [fixed] #177 Use '0.0.0.0' as host not 'localhost' (If you want to change host, you can use `--host` option with `start` command)
4
+
1
5
  Release 0.3.19 - 2015/04/08
2
6
  * [maintenance] #170 Update some gems
3
7
  * [maintenance] #171 Update Rails to 4.2.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluentd-ui (0.3.19)
4
+ fluentd-ui (0.3.20)
5
5
  addressable
6
6
  bundler
7
7
  diff-lcs
@@ -1,5 +1,5 @@
1
1
  class UsersController < ApplicationController
2
- before_action :find_user
2
+ before_action :set_user
3
3
 
4
4
  def show
5
5
  end
@@ -14,7 +14,7 @@ class UsersController < ApplicationController
14
14
 
15
15
  private
16
16
 
17
- def find_user
17
+ def set_user
18
18
  @user = User.new(name: session[:user_name])
19
19
  end
20
20
 
data/app/models/user.rb CHANGED
@@ -57,7 +57,9 @@ class User
57
57
  end
58
58
 
59
59
  def valid_password_confirmation
60
- password == password_confirmation
60
+ if password != password_confirmation
61
+ errors.add(:password, :confirmation, attribute: User.human_attribute_name(:password_confirmation))
62
+ end
61
63
  end
62
64
 
63
65
  def stretching_cost
@@ -10,13 +10,14 @@ module FluentdUI
10
10
  option :port, type: :numeric, default: 9292
11
11
  option :pidfile, type: :string, default: File.expand_path('tmp/fluentd-ui.pid', ROOT)
12
12
  option :daemonize, type: :boolean, default: false
13
+ option :host, type: :string, default: '0.0.0.0'
13
14
  def start
14
15
  trap(:INT) { puts "\nStopping..." }
15
16
  # NOTE: on Debian based distributions, td-agent uses start-stop-daemon with --exec option for stopping process
16
17
  # then fluentd-ui will be killed by them because given --exec option matches.
17
18
  # FLUENTD_UI_EXEC_COMMAND is used for workaround it.
18
19
  cmd = ENV['FLUENTD_UI_EXEC_COMMAND'].presence || "rackup"
19
- system(* %w(bundle exec) + cmd.split(" ") + %W(#{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} -E production #{ROOT}/config.ru))
20
+ system(* %w(bundle exec) + cmd.split(" ") + %W(#{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} --host #{options[:host]} -E production #{ROOT}/config.ru))
20
21
  end
21
22
 
22
23
 
@@ -1,3 +1,3 @@
1
1
  module FluentdUI
2
- VERSION = "0.3.19"
2
+ VERSION = "0.3.20"
3
3
  end
@@ -43,7 +43,7 @@ describe "sessions" do
43
43
 
44
44
  after do
45
45
  # reset password to the default
46
- FileUtils.rm_rf(User::ENCRYPTED_PASSWORD_FILE)
46
+ FileUtils.rm_f(User::ENCRYPTED_PASSWORD_FILE)
47
47
  end
48
48
 
49
49
  context "correct password" do
@@ -1,9 +1,53 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "users" do
4
- describe "edit" do
4
+ describe "visit edit page before login" do
5
5
  let(:url) { user_path }
6
6
  it_should_behave_like "login required"
7
7
  end
8
8
 
9
+ describe "edit" do
10
+ let!(:user) { build(:user) }
11
+
12
+ before do
13
+ login_with user
14
+ end
15
+
16
+ after do
17
+ # reset password to the default
18
+ FileUtils.rm_f(User::ENCRYPTED_PASSWORD_FILE)
19
+ end
20
+
21
+ describe 'to change password' do
22
+ let(:current_password) { user.password }
23
+ let(:password) { 'new_password' }
24
+
25
+ before do
26
+ visit user_path
27
+ fill_in 'user[current_password]', with: current_password
28
+
29
+ fill_in 'user[password]', with: password
30
+ fill_in 'user[password_confirmation]', with: password_confirmation
31
+ click_button I18n.t("terms.update_password")
32
+ end
33
+
34
+ context 'when valid new password/confirmation is input' do
35
+ let(:password_confirmation) { password }
36
+
37
+ it 'should update users password with new password' do
38
+ expect(page).to have_css('.alert-success')
39
+ expect(user.stored_digest).to eq user.digest(password)
40
+ end
41
+ end
42
+
43
+ context 'when invalid new password/confirmation is input' do
44
+ let(:password_confirmation) { 'invalid_password' }
45
+
46
+ it 'should not update users password with new password' do
47
+ expect(page).to have_css('.alert-danger')
48
+ expect(user.stored_digest).to eq user.digest(current_password)
49
+ end
50
+ end
51
+ end
52
+ end
9
53
  end
@@ -4,11 +4,55 @@ describe User do
4
4
  let(:user) { build(:user) }
5
5
 
6
6
  describe "#valid?" do
7
+ subject { user.valid? }
8
+
7
9
  describe "password" do
8
- it "password != password_confirmation is invalid" do
9
- user.password = "a"
10
- user.password_confirmation = "b"
11
- user.should_not be_valid
10
+ before do
11
+ user.current_password = current_password
12
+ user.password = password
13
+ user.password_confirmation = password_confirmation
14
+ end
15
+
16
+ context 'when current_password is correct' do
17
+ let(:current_password) { user.password }
18
+
19
+ context 'when password/confirmation is 8 characters' do
20
+ let(:password) { 'a' * 8 }
21
+ let(:password_confirmation) { password }
22
+
23
+ it { should be_truthy }
24
+ end
25
+
26
+ context 'when password is 7 characters' do
27
+ let(:password) { 'a' * 7 }
28
+ let(:password_confirmation) { password }
29
+
30
+ it 'should return false' do
31
+ should be_falsey
32
+ user.errors.keys.should == [:password]
33
+ end
34
+ end
35
+
36
+ context 'when password != password_confirmation' do
37
+ let(:password) { 'a' * 8 }
38
+ let(:password_confirmation) { 'b' * 8 }
39
+
40
+ it 'should return false' do
41
+ should be_falsey
42
+ user.errors.keys.should == [:password]
43
+ end
44
+ end
45
+ end
46
+
47
+ context 'when current_password is wrong' do
48
+ let(:current_password) { 'invalid_password' }
49
+ let(:password) { 'a' * 8 }
50
+ let(:password_confirmation) { password }
51
+
52
+ it 'should return false' do
53
+ should be_falsey
54
+ user.errors.keys.should == [:current_password]
55
+ end
12
56
  end
13
57
  end
14
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.19
4
+ version: 0.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-08 00:00:00.000000000 Z
12
+ date: 2015-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd