Skip to content

Commit

Permalink
#139 some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Suban05 committed Sep 19, 2024
1 parent bd92890 commit f2352ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion objects/baza/valve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def job
def to_json(*_args)
@to_json ||=
begin
row = @valves.pgsql.exec(
row = pgsql.exec(
[
'SELECT valve.*',
'FROM valve',
Expand Down
6 changes: 4 additions & 2 deletions test/baza/test_valve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def test_enter_valve_with_job
b = fake_name
w = 'why'
human.valves.enter(n, b, w, job.id) { 42 }
valve = human.valves.get(human.valves.each.to_a.first[:id])
valve = human.valves.get(human.valves.each.first[:id])
assert_equal(n, valve.name)
assert_equal(b, valve.badge)
assert_equal(w, valve.why)
assert_equal(job.id, valve.job.id)
assert_equal("BAhpLw==\n", valve.result)
end

def test_enter_valve_without_job
Expand All @@ -56,10 +57,11 @@ def test_enter_valve_without_job
b = fake_name
w = 'why'
human.valves.enter(n, b, w, nil) { 42 }
valve = human.valves.get(human.valves.each.to_a.first[:id])
valve = human.valves.get(human.valves.each.first[:id])
assert_equal(n, valve.name)
assert_equal(b, valve.badge)
assert_equal(w, valve.why)
assert_nil(valve.job)
assert_equal("BAhpLw==\n", valve.result)
end
end
2 changes: 1 addition & 1 deletion test/front/test_front_valves.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_read_valve
fake_login(n)
human = app.humans.ensure(n)
post('/valves/add', 'name=hi&badge=abc&why=nothing')
get("/valves/#{human.valves.each.to_a.first[:id]}")
get("/valves/#{human.valves.each.first[:id]}")
assert_status(200)
end
end

0 comments on commit f2352ea

Please sign in to comment.