Skip to content

Commit

Permalink
Merge pull request MarkUsProject#574 from Nifter/notes-fix-2
Browse files Browse the repository at this point in the history
Closes MarkUsProject#430. Fix: when creating a note, the selector for groups doesn't appear
  • Loading branch information
jerboaa committed Oct 26, 2011
2 parents 92f3f90 + 5c581aa commit f586e2a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/notes/_grouping.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% fields_for :note, :url => {:action => 'create'} do |f| %>
<%= fields_for :note, :url => {:action => 'create'} do |f| %>
<p>
<%= label_tag "assignment_id", I18n.t("notes.noteables.Assignment") %>
<%= select_tag "assignment_id",
Expand Down
30 changes: 30 additions & 0 deletions test/functional/notes_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,36 @@ def setup
assert assign_to :note
assert set_the_flash.to(I18n.t('notes.delete.success'))
end

should "have noteable options for selection when viewing noteable_type Grouping" do
@note = Note.make( :creator_id => @admin.id )
post_as @admin,
:create,
{:noteable_type => 'Grouping',
:note => {:noteable_id => @note.id,
:notes_message => @message}}
assert_tag :tag => 'select', :attributes => { :id => 'note_noteable_id' }
end

should "have noteable options for selection when viewing noteable_type Student" do
@note = Note.make( :creator_id => @admin.id )
post_as @admin,
:create,
{:noteable_type => 'Student',
:note => {:noteable_id => @note.id,
:notes_message => @message}}
assert_tag :tag => 'select', :attributes => { :id => 'note_noteable_id' }
end

should "have noteable options for selection when viewing noteable_type Assignment" do
@note = Note.make( :creator_id => @admin.id )
post_as @admin,
:create,
{:noteable_type => 'Assignment',
:note => {:noteable_id => @note.id,
:notes_message => @message}}
assert_tag :tag => 'select', :attributes => { :id => 'note_noteable_id' }
end
end
end # admin context
end

0 comments on commit f586e2a

Please sign in to comment.