Skip to content

Testing questions #2

Open
Open

Description

@czak

Hi, I'm the guy who committed 996ef55.
I needed the fix for an app I'm working on and it now works fine for me.

However I was not able to add a test case for the PR.
I could use some help on how you do testing and how to set them up to get started.
Are you using any kind of request mocking?

To be honest I'm confused by the very first spec: https://github.com/Fred-grais/transifex-interface-ruby/blob/master/spec/lib/transifex/configuration_spec.rb. How can both pass?

Activity

  1. Fred-grais commented on Oct 17, 2014

    @Fred-grais
    Owner

    Hello,

    firstly thanks for the commit, i'm happy that this GEM was usefull to
    somebody.

    About the mocking requests, i'm not using a such system. I'm querying the
    actual Transifex API.
    I know it is not a best practice but it is my first gem and i don't really
    know much about mocking requests, also i don't understand how mocking the
    API requests allow us to actually test the API in real conditions^^).

    What you got to do if you want to test your modifications is in
    https://github.com/Fred-grais/transifex-interface-ruby/blob/master/spec/spec_helper.rb

    You provide your own Transifex Credentials in reset_transifex_configuration and
    it should then perform the tests by querying the Transifex API ie create
    some projetc then delete it and so on...(it also should answer your last
    question)

    Note that for some tests i used a project that was already created on my
    Transifex Account like in
    https://github.com/Fred-grais/transifex-interface-ruby/blob/master/spec/lib/transifex/project_languages_spec.rb
    (line 5)

    So you could replace the Transifex::Project.new(slug) by
    Transifex::Projects.create(creation_params) in all the concerned files. I
    unfortunately don't have a functionnal Transifex Account anymore (trial
    expired).

    2014-10-17 18:31 GMT+02:00 Łukasz Adamczak notifications@github.com:

    Hi, I'm the guy who committed 996ef55
    996ef55
    .
    I needed the fix for an app I'm working on and it now works fine for me.

    However I was not able to add a test case for the PR.
    I could use some help on how you do testing and how to set them up to get
    started.
    Are you using any kind of request mocking?

    To be honest I'm confused by the very first spec:
    https://github.com/Fred-grais/transifex-interface-ruby/blob/master/spec/lib/transifex/configuration_spec.rb.
    How can both pass?

    —
    Reply to this email directly or view it on GitHub
    #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions