Skip to content

Commit

Permalink
A few more cleanups for Hound
Browse files Browse the repository at this point in the history
Signed-off-by: astolat shalott <shalott@gmail.com>
  • Loading branch information
shalott committed Nov 17, 2015
1 parent b1d3c54 commit e80d7b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 7 additions & 9 deletions features/step_definitions/collection_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

When /^I add my work to the collection$/ do
step %{I follow "Add To Collection"}
fill_in("collection_names", :with => "Various_Penguins")
fill_in("collection_names", with: "Various_Penguins")
click_button("Add")
end

Expand All @@ -24,7 +24,7 @@
c = Collection.find_by_title(collection_title)
visit work_path(w)
click_link "Add To Collection"
fill_in("collection_names", :with => c.name)
fill_in("collection_names", with: c.name)
click_button("Add")
end

Expand All @@ -34,12 +34,10 @@
end

Given /^mod1 lives in Alaska$/ do
step %{I am logged in as "mod1" with password "something"}

step %{I go to mod1's preferences page}
#'
step %{I am logged in as "mod1"}
step %{I go to mod1 preferences page}
step %{I select "(GMT-09:00) Alaska" from "preference_time_zone"}
step %{I press "Update"}
step %{I press "Update"}
end

Given /^(?:I have )?(?:a|an|the) (hidden)?(?: )?(anonymous)?(?: )?(moderated)?(?: )?(closed)?(?: )?collection "([^\"]*)"(?: with name "([^\"]*)")?$/ do |hidden, anon, moderated, closed, title, name|
Expand Down Expand Up @@ -90,8 +88,8 @@

When /^I set up (?:a|the) collection "([^"]*)"(?: with name "([^"]*)")?$/ do |title, name|
visit new_collection_url
fill_in("collection_name", :with => name.blank? ? title.gsub(/[^\w]/, '_') : name)
fill_in("collection_title", :with => title)
fill_in("collection_name", with: (name.blank? ? title.gsub(/[^\w]/, '_') : name))
fill_in("collection_title", with: title)
end

When /^I create (?:a|the) collection "([^"]*)"(?: with name "([^"]*)")?$/ do |title, name|
Expand Down
5 changes: 2 additions & 3 deletions features/step_definitions/series_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
work = Work.find_by_title(work_title)
series = Series.find_by_title(series_title)
position = SerialWork.where(series_id: series, work_id: work).first.position
neighbors = SerialWork.where(series_id: series, position: [position-1, position+1])
neighbors = SerialWork.where(series_id: series, position: [position - 1, position + 1])
neighbors.each_with_index do |neighbor, index|
visit work_path(neighbor.work)
# the neighbors should link to each other if they both exist
Expand All @@ -111,7 +111,7 @@
work = Work.find_by_title(work_title)
series = Series.find_by_title(series_title)
position = SerialWork.where(series_id: series, work_id: work).first.position
neighbors = SerialWork.where(series_id: series, position: [position-1, position+1])
neighbors = SerialWork.where(series_id: series, position: [position - 1, position + 1])
neighbors.each do |neighbor|
visit work_path(neighbor.work)
if neighbor.position > position
Expand All @@ -123,4 +123,3 @@
end
end
end

0 comments on commit e80d7b7

Please sign in to comment.