mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-21 06:24:22 -04:00
Added creator to scientific name views etc
This commit is contained in:
1 parent
a5b2db3458
commit
836ed7aa85
3 files changed
+11
No files matched your search
@@ -45,6 +45,7 @@ class ScientificNamesController < ApplicationController
|
||||
# POST /scientific_names
|
||||
# POST /scientific_names.json
|
||||
def create
|
||||
params[:scientific_name][:creator_id] = current_member.id
|
||||
@scientific_name = ScientificName.new(params[:scientific_name])
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
- content_for :title, "Edit scientific name"
|
||||
|
||||
%p
|
||||
Added by
|
||||
= @scientific_name.creator
|
||||
= distance_of_time_in_words(@scientific_name.created_at, Time.zone.now)
|
||||
ago.
|
||||
|
||||
= render 'form'
|
||||
@@ -12,6 +12,10 @@ describe "scientific_names/edit" do
|
||||
render
|
||||
end
|
||||
|
||||
it "shows the creator" do
|
||||
rendered.should contain "Added by #{@scientific_name.creator} less than a minute ago."
|
||||
end
|
||||
|
||||
it "renders the edit scientific_name form" do
|
||||
assert_select "form", :action => scientific_names_path(@scientific_name), :method => "post" do
|
||||
assert_select "input#scientific_name_scientific_name", :name => "scientific_name[scientific_name]"
|
||||
|
||||
Reference in new issue
Block a user