rspec - Rails model specs passing, Sidekiq spec failing -


I am creating a rail (4.1.0) which runs the election. In each survey, there are n seats with n matching my model:

  class matches & lt; ActiveRecord :: Base is_mount: Seats, Dependent :: def win_seat seats.sort {| a, b A.number_of_votes & lt; = & Gt; B.number_of_votes}. The last ending class seat & lt; ActiveRecord :: Base is_to: matchup validates: matchup, presence: correct confirmation: number_of_votes, presence: true def declare_as_winner self.is_winner = true self.save end end   

for Milan and seat At the end of a survey without the specs, I have to show the winner. I am using a sidekick worker to handle the end of the survey. It does a lot of things, but here's the code in question: Class EndOfPollWorker includes Sidekick :: Worker DRF poll (poll_id) poll = place (: id poll_id) poll.matchups Do .each | matchup | To grab the winning seat winning seat, it's declared as a winning winning_seat.declare_as_winner end and end.

There is no space pass for this worker:

 'Code_helper' is required before 'endoffolbokar' # For each simple question, For each entry, matchup @ paul = poll.bild_paul and context 'prepares a matchup when voting ends' winner = @ poll.matchups.map {| Matchup | Matchup.seats.first} @Loggers = @ poll.matchups.map {| Matchup | matchup.seats.last} winners. Seat | Seat.number_of_votes = 1 end @ poll.save! @job = Andopoloborker. Time ends 'It updates every matchup' dot @ job .form (@ poll.id) winner of the winner. (Seat.Is_Winner?) Is expected (this is true) Finally 'this is every matchup' dot @ job ' ('Poll.id) @ losers.each do | The losers of the seat do not update. (Seat.is_winner?) Should be (false) and end and end and end   

When I run this idea, I will find:

  AndOfPower Updating the winner of each matchup when the election ends, Failure / Error: My specs (seat.is_winner?) May be true for seat and matching model   

Nearly OK I have hacked a lot of test codes, so ma Ph, do not assume this is a problem!

In addition, when the workers actually walk in development mode, then the seat.

Thanks

Sideshow has nothing to do with your problem So that the problem is with the RSPC and the Active Recorder. For example, drag the code out of the display method and keep it straight, it should still be unsuccessful.

I suspect that the examples are stale and # need to be reloaded to take the database up. Make up the changes made in #formform.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -