title: AngularJS - Unit testing service with value dependency injection
body: <p>I am currently experimenting with AngularJS. I have created a simple service, which is initialized from some distant data. The url is passed as an application value.</p>
  
  <pre><code>//App declaration
  angular.module('myApp', ['myApp.services']).value('someUrl', 'http://www.example.com');
  
  //Service declaration
  angular.module('myApp.services', ['someUrl']).factory('MyService', function(someUrl) {
      var data;
      "Do stuff"  
      return data;
  });
  </code></pre>
  
  <p>Now, I am trying to unit test this, but I cannot manage to correctly set the "someUrl" parameter. I have tried things like this, without succes:</p>
  
  <pre><code>angular.module('myApp', ['myApp.services']).value('someUrl', 'test/test.json');
  
  describe('Services', function() {
      beforeEach(module('myApp.services'));
  
      describe('MyService', function() {
          it('should return {success: true}', inject(function() {
              expect(data).toEqual({success: true});
          }));
      });
  });
  </code></pre>
  
  <p>However, I always receive a "No module: someUrl" error. What is the correct syntax to initialize an app value during a unit test?</p>