mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Fix some review issues such as naming and typos
This commit is contained in:
@@ -1003,7 +1003,7 @@ en:
|
||||
hour_html:
|
||||
one: "<i>%{count} hour</i>"
|
||||
other: "<i>%{count} hours</i>"
|
||||
updated: "changed from %{first} to %{last}"
|
||||
updated: "changed from %{old_value} to %{value}"
|
||||
logged_for: "Logged for"
|
||||
filter:
|
||||
changeset: "Changesets"
|
||||
|
||||
@@ -43,19 +43,19 @@ class OpenProject::JournalFormatter::TimeEntryHours < JournalFormatter::Base
|
||||
(val % 1).zero? ? val.to_i : val
|
||||
end
|
||||
|
||||
def value(html, first, last)
|
||||
def value(html, old_value, value)
|
||||
html = html ? '_html' : ''
|
||||
|
||||
first = format_float(first) if first
|
||||
last = format_float(last)
|
||||
old_value = format_float(old_value) if old_value
|
||||
value = format_float(value)
|
||||
|
||||
if first
|
||||
if old_value
|
||||
I18n.t(:'activity.item.time_entry.updated',
|
||||
first: I18n.t(:"activity.item.time_entry.hour#{html}", count: first),
|
||||
last: I18n.t(:"activity.item.time_entry.hour#{html}", count: last))
|
||||
old_value: I18n.t(:"activity.item.time_entry.hour#{html}", count: old_value),
|
||||
value: I18n.t(:"activity.item.time_entry.hour#{html}", count: value))
|
||||
else
|
||||
I18n.t(:"activity.item.time_entry.hour#{html}",
|
||||
count: last)
|
||||
count: value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -122,7 +122,7 @@ RSpec.describe Activities::ItemComponent, type: :component do
|
||||
end
|
||||
end
|
||||
|
||||
context 'for TimeEntry activites' do
|
||||
context 'for TimeEntry activities' do
|
||||
let(:journal) { build_stubbed(:time_entry_journal) }
|
||||
let(:event) do
|
||||
Activities::Event.new(
|
||||
|
||||
+10
-11
@@ -6,19 +6,18 @@ require 'rack_session_access/capybara'
|
||||
require 'action_dispatch'
|
||||
|
||||
RSpec.shared_context 'with default_url_options and host name set to Capybara test server' do
|
||||
before do
|
||||
@original_host = default_url_options[:host]
|
||||
@original_port = default_url_options[:port]
|
||||
@original_host_setting = Setting.host_name
|
||||
Setting.host_name = "#{Capybara.server_host}:#{Capybara.server_port}"
|
||||
around do |example|
|
||||
original_host = default_url_options[:host]
|
||||
original_port = default_url_options[:port]
|
||||
original_host_setting = Setting.host_name
|
||||
default_url_options[:host] = Capybara.server_host
|
||||
default_url_options[:port] = Capybara.server_port
|
||||
end
|
||||
|
||||
after do
|
||||
default_url_options[:host] = @original_host # rubocop:disable RSpec/InstanceVariable
|
||||
default_url_options[:port] = @original_port # rubocop:disable RSpec/InstanceVariable
|
||||
Setting.host_name = @original_host_setting # rubocop:disable RSpec/InstanceVariable
|
||||
Setting.host_name = "#{Capybara.server_host}:#{Capybara.server_port}"
|
||||
example.run
|
||||
ensure
|
||||
default_url_options[:host] = original_host
|
||||
default_url_options[:port] = original_port
|
||||
Setting.host_name = original_host_setting
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user