Merge branch 'master' into legislation-module-stable
This commit is contained in:
@@ -31,4 +31,19 @@ describe GeozonesHelper do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#geozone_name_from_id" do
|
||||
|
||||
it "returns geozone name if present" do
|
||||
g1 = create(:geozone, name: "AAA")
|
||||
g2 = create(:geozone, name: "BBB")
|
||||
|
||||
expect(geozone_name_from_id(g1.id)).to eq "AAA"
|
||||
expect(geozone_name_from_id(g2.id)).to eq "BBB"
|
||||
end
|
||||
|
||||
it "returns default string for no geozone if geozone is blank" do
|
||||
expect(geozone_name_from_id(nil)).to eq "All city"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe OrdersHelper do
|
||||
|
||||
describe '#valid_orders' do
|
||||
it 'displays relevance when searching' do
|
||||
params[:search] = 'ipsum'
|
||||
assign(:valid_orders, %w(created_at random relevance))
|
||||
expect(helper.valid_orders).to eq %w(created_at random relevance)
|
||||
end
|
||||
|
||||
it 'does not display relevance when not searching' do
|
||||
assign(:valid_orders, %w(created_at random relevance))
|
||||
expect(helper.valid_orders).to eq %w(created_at random)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -28,6 +28,15 @@ describe UsersHelper do
|
||||
|
||||
expect(comment_commentable_title(comment)).to eq "<abbr title='This proposal has been deleted'>#{comment.commentable.title}</abbr>"
|
||||
end
|
||||
|
||||
it "should return the appropriate message for deleted budget investment" do
|
||||
investment = create(:budget_investment)
|
||||
comment = create(:comment, commentable: investment)
|
||||
|
||||
investment.hide
|
||||
|
||||
expect(comment_commentable_title(comment)).to eq "<abbr title='This investment has been deleted'>#{comment.commentable.title}</abbr>"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#comment_commentable_title' do
|
||||
|
||||
Reference in New Issue
Block a user