When(/^I click the "(.+)" template$/) do |name|
  @context.click_template_square(name)
end

When(/^I open the new template modal$/) do
  find('.dotted-box').click
end

When(/^I open the type dropwdown for a field$/) do
  @context.open_type_dropdown
end

Then(/^I should be on the edit page for the "(.+)" template$/) do |name|
  @context.expect_on_edit_page(name)
end

Then(/^the template should exist$/) do
  @context.expect_in_database
end

Then(/^the template should have 1 field named "(.+)"$/) do |name|
  @context.expect_one_field(name)
end

Then(/^the type dropdown shouldn't have the following menu options:$/) do |table|
  @context.expect_not_in_type_dropdown(table.rows)
end
