This repository has been archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #804 from ctumwebaze/master
remove reunited label and field rapidftr/tracker#265
- Loading branch information
Showing
7 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<form class="filter_panel"> | ||
<input type="hidden" name="order_by" value="<%= @order %>"/> | ||
<%= t("children.filter_by.label") %>: | ||
<span> <%= select_tag :filter, options_for_select([[ t("children.filter_by.all"), "" ],[t("children.filter_by.active"),"active"],[t("children.filter_by.reunited"),"reunited"], | ||
[t("children.filter_by.flagged"),"flag"]], @filter), { :onchange => "this.form.submit();"} %> </span> | ||
<% | ||
options = [[ t("children.filter_by.all"), "" ],[t("children.filter_by.active"),"active"]] | ||
|
||
if enquiries_enabled | ||
options << [t("children.filter_by.reunited"),"reunited"] | ||
end | ||
|
||
options << [t("children.filter_by.flagged"),"flag"] | ||
%> | ||
<span> <%= select_tag :filter, options_for_select(options, @filter), { :onchange => "this.form.submit();"} %> </span> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
require 'spec_helper' | ||
|
||
describe 'children/index.html.erb', :type => :view do | ||
|
||
before do | ||
@user = double('user', :has_permission? => true, :user_name => 'name', :id => 'test-user-id') | ||
|
||
allow(@user).to receive(:localize_date).and_return('July 19 2010 13:05:32UTC') | ||
allow(controller).to receive(:current_user).and_return(@user) | ||
allow(view).to receive(:current_user).and_return(@user) | ||
allow(view).to receive(:logged_in?).and_return(true) | ||
allow(view).to receive(:current_user_name).and_return('name') | ||
|
||
@highlighted_fields = [ | ||
Field.new(:name => 'child_father', :display_name => 'Father of child', :visible => true), | ||
Field.new(:name => 'child_name', :display_name => 'child_name', :visible => true)] | ||
allow(Form).to receive(:find_by_name).and_return(double('Form', :sorted_highlighted_fields => @highlighted_fields, :title_fields => [])) | ||
end | ||
|
||
context 'when enquiries are turned off' do | ||
before :each do | ||
@enable_enquiries = SystemVariable.create!(:name => SystemVariable::ENABLE_ENQUIRIES, :type => 'boolean', :value => 0) | ||
end | ||
|
||
after :each do | ||
@enable_enquiries.destroy | ||
end | ||
|
||
it 'should not show the reunited filter' do | ||
render | ||
expect(rendered).to_not have_tag('option[value="reunited"]') | ||
end | ||
end | ||
|
||
context 'when enquiries are turned on' do | ||
before :each do | ||
@enable_enquiries = SystemVariable.create!(:name => SystemVariable::ENABLE_ENQUIRIES, :type => 'boolean', :value => 1) | ||
end | ||
|
||
after :each do | ||
@enable_enquiries.destroy | ||
end | ||
|
||
it 'should show the reunited filter' do | ||
render | ||
expect(rendered).to have_tag('option[value="reunited"]') | ||
end | ||
end | ||
end |