Method: EasyqaApi::TestModule#create

Defined in:
lib/easyqa_api/items/test_module.rb

#create(attrs, user = @@default_user) ⇒ Hash

Create test module on EasyQA website. Have a class method analog

Parameters:

  • (defaults to: @@default_user)

    authenticated user in EasyQA

  • attributes for action

Options Hash (attrs):

  • :project_token (String) — default: @project_token

    Project token on EasyQA

  • :title (String)

    test module title on EasyQA website

  • :description (String)

    test module description

  • :parent_id (Fixnum)

    id of parent test module. If you give this parameter, this test module will be nested in parent test module.

  • :test_plan_id (Fixnum) — default: @test_plan_id

    Test plan id

Returns:

  • item attribtues on EasyQA website

See Also:



43
44
45
46
47
48
49
50
51
52
# File 'lib/easyqa_api/items/test_module.rb', line 43

def create(attrs, user = @@default_user)
  attrs = { project_token: @project_token, test_plan_id: @test_plan_id }.merge(attrs)
  @attributes = send_request("test_plans/#{attrs[:test_plan_id]}/test_modules", :post) do |req|
    req.body = {
      test_module: attrs.except(:project_token, :test_plan_id),
      token: attrs[:project_token],
      auth_token: user.auth_token
    }
  end
end