Merge pull request #169 from attlebish/fixsenderlink

Fixed link to sender profile in notifications
This commit is contained in:
Skud
2013-04-03 21:02:14 -07:00
2 changed files with 7 additions and 3 deletions

View File

@@ -13,9 +13,9 @@
%tr
%td
- if n.read
= link_to n.sender
= link_to n.sender, member_path(n.sender)
- else
%strong= link_to n.sender
%strong= link_to n.sender, member_path(n.sender)
%td
- if n.read
= link_to n.subject, notification_path(n)

View File

@@ -6,13 +6,17 @@ describe "notifications/index" do
controller.stub(:current_user) { @member }
@notification = FactoryGirl.create(:notification, :sender => @member, :recipient => @member)
assign(:notifications, [ @notification, @notification ])
render
end
it "renders a list of notifications" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
assert_select "table"
assert_select "tr>td", :text => @notification.sender.to_s, :count => 2
assert_select "tr>td", :text => @notification.subject, :count => 2
end
it "links to sender's profile" do
assert_select "a", :href => member_path(@notification.sender)
end
end