summaryrefslogtreecommitdiff
path: root/spec/helpers/todos_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/todos_helper_spec.rb')
-rw-r--r--spec/helpers/todos_helper_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/helpers/todos_helper_spec.rb b/spec/helpers/todos_helper_spec.rb
index a8945424877..c64d5990cd9 100644
--- a/spec/helpers/todos_helper_spec.rb
+++ b/spec/helpers/todos_helper_spec.rb
@@ -292,4 +292,22 @@ RSpec.describe TodosHelper do
it { is_expected.to eq(result) }
end
end
+
+ describe '#todos_filter_params' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:state, :result) do
+ 'done' | 'done'
+ 'pending' | 'pending'
+ '' | nil
+ end
+
+ with_them do
+ before do
+ allow(helper).to receive(:params).and_return({ state: state })
+ end
+
+ it { expect(helper.todos_filter_params[:state]).to eq(result) }
+ end
+ end
end