Coder Social home page Coder Social logo

Comments (7)

tomykaira avatar tomykaira commented on July 20, 2024

slug を入力しないカテゴリを複数作成できないです。

from lokka.

tomykaira avatar tomykaira commented on July 20, 2024

パッチを作成しました。
テストしてみてください: https://github.com/komagata/lokka/pull/142

The cause was that the POSTed slug is "" when no slug is specified.
Category model had unique constraint for slug and title, therefore @category.save failed.

In Entry model, uniqueness is ensured with dm-validations, and it does not use DB constraint.
I follow the way.

from lokka.

komagata avatar komagata commented on July 20, 2024

Looks like CI failed.

http://travis-ci.org/#!/komagata/lokka/jobs/596760

from lokka.

tomykaira avatar tomykaira commented on July 20, 2024

CI still fails against Postgres.

http://travis-ci.org/#!/komagata/lokka/builds/613447

That is because spec_seeds.rb specifies :id of Category's first instance apparently,

Category.create(:id => 1,
                :title => 'Test Category',
                :created_at => created_at,
                :updated_at => updated_at)

but my category_spec.rb does not.

The main cause is that datamapper does not update categories_id_seq when :id is specified.
(Simple test: https://gist.github.com/1726651)

I did not specify :id because it is not specified when created in application.
Therefore, I'm not happy with the idea that create all Category items with :id in that unit test.
However, I know that controlling :id is important for integration tests. So it could be the only possible solution.

By the way, I disagree with using the same fixture between all test, because it makes implicit dependency between tests like this.

How can we work around this problem? Tell me your idea!

from lokka.

komagata avatar komagata commented on July 20, 2024

Oh I see.
I think so too. I don't want to use :id and fixture.
It's no probrem that fixture will replace with "fixture replacement library".

from lokka.

tomykaira avatar tomykaira commented on July 20, 2024

Now CI passes.
@johnny-miyake , thank you for reporting problem.
@komagata , thank you for kind advice.

from lokka.

komagata avatar komagata commented on July 20, 2024

omg! CI is back! thanks @tomykaira

from lokka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.