[tog_conversatio] even transition name for publishing a post should be publish!

4 views
Skip to first unread message

Balint Erdi

unread,
Feb 25, 2009, 9:28:00 AM2/25/09
to tog_users
Hi,

In post.rb de tog_conversatio, there is the following snippet:

event :published do
transitions :from => [:draft] , :to => :published
end

Event names IMO should be verbs whenever possible even more so since
as it is now I have to do:

post.published!

to make a post published (which should be post.publish!)

So the code snippet should be replaced by:

event :publish do
transitions :from => [:draft] , :to => :published
end


What do you think?
Balint

Alberto Molpeceres

unread,
Feb 25, 2009, 9:49:56 AM2/25/09
to tog_...@googlegroups.com
> What do you think?
> Balint


Sure!. I'm sure Roberto will be happy if you for the repo in github
and send him a pull request XD.

al.

Balint Erdi

unread,
Feb 26, 2009, 4:24:58 AM2/26/09
to tog_users
I have done just that, sending the pull req. to the tog user.

On a side note, I could not run the tests of tog_conversation neither
in "standalone" mode nor when plugged in to a host application. That
latter presented me with an unpleasant:

/Users/balint/code/rails/host_for_tog_conversatio/vendor/plugins/
tog_conversatio/init.rb:1:in `evaluate_init_rb': undefined method
`require_plugin' for #<Rails::Plugin:0x21ba9ac> (NoMethodError) (I
have not found require_plugin in the Rails 2.2.2 source anywhere)

Is this a known issue?
Balint

On Feb 25, 3:49 pm, Alberto Molpeceres <alberto.molpece...@gmail.com>
wrote:

Aitor Garcia Rey

unread,
Feb 26, 2009, 4:37:38 AM2/26/09
to tog_...@googlegroups.com
This is defined in tog-desert... Do the app starts correctly?
--
Kind Regards,
Aitor Garcia
Cofounder - Linking Paths
http://www.linkingpaths.com

Balint Erdi

unread,
Feb 26, 2009, 10:53:01 AM2/26/09
to tog_users
Thank you, so the tests should be run inside a "tog-enabled" rails
app, is that it?

I tried that (standing in /vendor/plugins/tog_conversatio I did: rake
test) and it worked, the tests were run but there were quite some
errors so I would not be able to see if my simple change works as it
should.

Balint

ps. A sample error:

test: A Post should find one result. (PostTest):
ActiveRecord::RecordInvalid: Validation failed: Summary no puede estar
en blanco

Alberto Molpeceres

unread,
Feb 26, 2009, 11:36:07 AM2/26/09
to tog_...@googlegroups.com
Yeah, tog-enabled app would be nice XD.

Then you can run the test for a given plugin with:

rake tog:plugins:test PLUGIN=plugin_name

(http://wiki.github.com/tog/tog/developer-faq#run_plugin_tests)

Balint Erdi

unread,
Feb 27, 2009, 5:04:38 AM2/27/09
to tog_users
I did it like this and it gives lots of errors as I describe above.

Balint

On Feb 26, 5:36 pm, Alberto Molpeceres <alberto.molpece...@gmail.com>
wrote:
> Yeah, tog-enabled app would be nice XD.
>
> Then you can run the test for a given plugin with:
>
> rake tog:plugins:test PLUGIN=plugin_name
>
> (http://wiki.github.com/tog/tog/developer-faq#run_plugin_tests)
>

Alberto Molpeceres

unread,
Feb 27, 2009, 5:13:40 AM2/27/09
to tog_...@googlegroups.com
Balint,

Ough, I didn't read your mail properly XD. This is a known issue that
we don't know/we haven't decide how to solve yet.

You are testing this plugin in a project that extends conversatio
(field 'summary' isn't part of conversatio), and this field is
declared as mandatory in your project. The factory used by
tog_conversatio's test doesn't set this field, so any try to
instantiate a Post fails, so every test using a Post fails.

Any Idea about solving this is welcomed!.
Reply all
Reply to author
Forward
0 new messages